Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 08-06-2011, 05:38 PM   #1
davidnye
Member
davidnye began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2011
Device: Nook
Democracy Journal recipe?

I'm interested in developing a recipe for Democracy Journal ( http://www.democracyjournal.org ), but I have no idea where to begin. Each article from the current issue appears as a .php link from the main page. RSS is not supported. Thanks for any help.
davidnye is offline   Reply With Quote
Old 08-06-2011, 08:37 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by davidnye View Post
I'm interested in developing a recipe for Democracy Journal ( http://www.democracyjournal.org ), but I have no idea where to begin. Each article from the current issue appears as a .php link from the main page. RSS is not supported. Thanks for any help.
If RSS is not available, then you must use parse_index. Read the sticky here for some links, or see here:
http://manual.calibre-ebook.com/news.html#news
Starson17 is offline   Reply With Quote
Old 02-24-2013, 09:26 PM   #3
davidnye
Member
davidnye began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2011
Device: Nook
Here's a recipe for Democracy Journal:

Code:
class AdvancedUserRecipe1361743898(BasicNewsRecipe):
    title = u'Democracy Journal'
    description = '''A journal of ideas. Published quarterly.'''
    __author__ = u'David Nye'
    oldest_article = 90
    max_articles_per_feed = 30
    no_stylesheets = True
    auto_cleanup = True
    
    def parse_index(self):
        articles = []
        feeds = []
        soup = self.index_to_soup("http://www.democracyjournal.org")
        for x in soup.findAll(href=re.compile("http://www\.democracyjournal\.org/\d*/.*php$")):
            url = x.get('href')
            title = self.tag_to_string(x)
            articles.append({'title':title, 'url':url, 'description':'', 'date':''})
        feeds.append(('Articles', articles))
        return feeds
        
    def print_version(self, url):
        return url + '?page=all'
davidnye is offline   Reply With Quote
Old 02-26-2013, 08:09 AM   #4
davidnye
Member
davidnye began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2011
Device: Nook
BTW, thanks Starson17 for the tip about using parse_index. When I finally got down to it, writing the recipe was easier and more fun than I thought it would be.
davidnye is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Recipe request: World Journal teraflame Recipes 0 03-09-2011 01:11 PM
New Journal of Physics recipe chemacortes Recipes 0 01-05-2011 08:08 AM
Poughkeepsie Journal recipe weebl Recipes 0 12-02-2010 08:56 AM
New England of Journal recipe Ebookerr Calibre 1 08-26-2010 04:59 AM
Wall Street Journal Recipe Quality? rhsanborn Calibre 6 12-04-2008 11:42 PM


All times are GMT -4. The time now is 12:34 PM.


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