Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 02-13-2011, 03:19 PM   #1
Dereks
Connoisseur
Dereks began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 1
Google Recipe problem

Hi, I've been using a modified version of google reader uber recipe for quite some time.
It was designed to get specifically last 50 starred items from my reader list.
Today when I downloaded the recipe, the file appeared to be empty. The file was generated properly, but with no contents, besides this message:

Quote:
Failed feed: starred

TypeError('expected string or buffer',)
Here is the recipe code I was using:

Code:
import urllib, re, mechanize
from calibre.web.feeds.recipes import BasicNewsRecipe
from calibre import __appname__

class GoogleReader(BasicNewsRecipe):
    title   = 'Google Starred'
    description = 'This recipe downloads feeds you have tagged from your Google Reader account.'
    needs_subscription = True
    __author__ = 'davec'
    base_url = 'http://www.google.com/reader/atom/'
    oldest_article = 365
    max_articles_per_feed = 50
    get_options = '?n=50'
    preferred_feeds = ('starred', ) 
    use_embedded_content = True
    extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "monospace1";src:url(res:///opt/sony/ebook/FONT/tt0419m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{text-align: left; font-family: "serif1"} .article_date{font-family: "monospace1"}'

    def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        if self.username is not None and self.password is not None:
            request = urllib.urlencode([('Email', self.username), ('Passwd', self.password),
                                        ('service', 'reader'), ('accountType', 'HOSTED_OR_GOOGLE'), ('source', __appname__)])
            response = br.open('https://www.google.com/accounts/ClientLogin', request)
            auth = re.search('Auth=(\S*)', response.read()).group(1)
            print 'Auth is: ', auth
            cookies = mechanize.CookieJar()
            br = mechanize.build_opener(mechanize.HTTPCookieProcessor(cookies))
            br.addheaders = [('Authorization', 'GoogleLogin auth='+auth)]
        return br

    def get_feeds(self):
        feeds = []
        soup = self.index_to_soup('http://www.google.com/reader/api/0/tag/list')
        for id in soup.findAll(True, attrs={'name':['id']}):
            url = id.contents[0]
            feed_name = re.search('/([^/]*)$', url).group(1)
            if not self.preferred_feeds or feed_name in self.preferred_feeds:
                 feeds.append((feed_name,
                          self.base_url + urllib.quote(url.encode('utf-8')) + self.get_options))
        return feeds
I accessed google reader API - list of feeds is still there, unchanged, therefore have no idea what may be the problem...
Dereks is offline   Reply With Quote
Old 02-13-2011, 03:21 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,308
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
re-install 0.7.45
kovidgoyal is offline   Reply With Quote
Advert
Old 02-13-2011, 03:48 PM   #3
Dereks
Connoisseur
Dereks began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 1
just did that. Same error.
Dereks is offline   Reply With Quote
Old 02-14-2011, 01:02 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by Dereks View Post
Quote:
Originally Posted by kovidgoyal View Post
re-install 0.7.45
just did that. Same error.
If I follow things here correctly you have to delete any 0.7.45 msi you have then download a fresh copy. Uninstall calibre then reinstall from this fresh copy.
DoctorOhh is offline   Reply With Quote
Old 02-16-2011, 08:48 AM   #5
Dereks
Connoisseur
Dereks began at the beginning.
 
Posts: 57
Karma: 10
Join Date: Feb 2010
Device: Kindle Paperwhite 1
ok. that helped. Thanks.
Dereks is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Google Reader Recipe hack - Download all unread insted of just starred rollercoaster Recipes 82 06-17-2011 04:39 PM
Google Reader recipe not working :( techie_007 Calibre 1 01-26-2010 09:58 PM
Tagging and deleting for Google Reader Recipe jomaweb Calibre 14 01-26-2010 11:31 AM
Recipe Google Reader vs Google Reader Uber DoctorOhh Calibre 0 01-26-2010 04:37 AM
Google Uber Recipe takes so much time jomaweb Calibre 1 01-26-2010 03:21 AM


All times are GMT -4. The time now is 11:39 AM.


MobileRead.com is a privately owned, operated and funded community.