| 1 |
import re |
| 2 |
|
| 3 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 4 |
|
| 5 |
|
| 6 |
class AdvancedUserRecipe1361743898(BasicNewsRecipe): |
| 7 |
title = 'Democracy Journal' |
| 8 |
description = '''A journal of ideas. Published quarterly.''' |
| 9 |
__author__ = 'David Nye' |
| 10 |
language = 'en' |
| 11 |
oldest_article = 90 |
| 12 |
max_articles_per_feed = 30 |
| 13 |
no_stylesheets = True |
| 14 |
auto_cleanup = True |
| 15 |
|
| 16 |
def parse_index(self): |
| 17 |
articles = [] |
| 18 |
feeds = [] |
| 19 |
soup = self.index_to_soup('http://www.democracyjournal.org') |
| 20 |
for x in soup.findAll(href=re.compile(r'http://www\.democracyjournal\.org/\d*/.*php$')): |
| 21 |
url = x.get('href') |
| 22 |
title = self.tag_to_string(x) |
| 23 |
articles.append({'title': title, 'url': url, 'description': '', 'date': ''}) |
| 24 |
feeds.append(('Articles', articles)) |
| 25 |
return feeds |
| 26 |
|
| 27 |
def print_version(self, url): |
| 28 |
return url + '?page=all' |