![]() |
#1 |
Member
![]() Posts: 18
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.
|
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
http://manual.calibre-ebook.com/news.html#news |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 18
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' |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 18
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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |