diff --git a/resources/recipes/alternet.recipe b/resources/recipes/alternet.recipe index d9498c7a0c..f885225d31 100644 --- a/resources/recipes/alternet.recipe +++ b/resources/recipes/alternet.recipe @@ -15,7 +15,7 @@ class Alternet(BasicNewsRecipe): (u'Top Ten Campaigns', u'http://feeds.feedblitz.com/alternet_top_10_campaigns'), (u'Special Coverage Areas', u'http://feeds.feedblitz.com/alternet_coverage') ] - + remove_attributes = ['width', 'align','cellspacing'] remove_javascript = True use_embedded_content = False no_stylesheets = True diff --git a/resources/recipes/technology_review.recipe b/resources/recipes/technology_review.recipe new file mode 100644 index 0000000000..f001fcf4c1 --- /dev/null +++ b/resources/recipes/technology_review.recipe @@ -0,0 +1,44 @@ +import string +from calibre.web.feeds.news import BasicNewsRecipe + +class TechnologyReview(BasicNewsRecipe): + title = u'Technology Review' + __author__ = 'rty' + description = 'MIT Technology Magazine' + publisher = 'Technology Review Inc.' + category = 'Technology, Innovation, R&D' + oldest_article = 14 + max_articles_per_feed = 100 + No_stylesheets = True + extra_css = """ + .ArticleBody {font: normal; text-align: justify} + .headline {font: bold x-large} + .subheadline {font: italic large} + """ + feeds = [ + (u'Computing', u'http://feeds.technologyreview.com/technology_review_Computing'), + (u'Web', u'http://feeds.technologyreview.com/technology_review_Web'), + (u'Communications', u'http://feeds.technologyreview.com/technology_review_Communications'), + (u'Energy', u'http://feeds.technologyreview.com/technology_review_Energy'), + (u'Materials', u'http://feeds.technologyreview.com/technology_review_Materials'), + (u'Biomedicine', u'http://feeds.technologyreview.com/technology_review_Biotech'), + (u'Business', u'http://feeds.technologyreview.com/technology_review_Biztech') + ] + remove_attributes = ['width', 'align','cellspacing'] + + remove_tags = [ + dict(name='div', attrs={'id':['CloseLink','footerAdDiv','copyright']}), + ] + remove_tags_after = [dict(name='div', attrs={'id':'copyright'})] + + def get_article_url(self, article): + return article.get('guid', article.get('id', None)) + + + def print_version(self, url): + baseurl='http://www.technologyreview.com/printer_friendly_article.aspx?id=' + split1 = string.split(url,"/") + xxx=split1 [4] + split2= string.split(xxx,"/") + s = baseurl + split2[0] + return s