diff --git a/src/calibre/gui2/images/news/time.png b/src/calibre/gui2/images/news/time.png new file mode 100644 index 0000000000..1939b183a6 Binary files /dev/null and b/src/calibre/gui2/images/news/time.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 0769a82c66..7006ff030d 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -19,6 +19,7 @@ recipe_modules = [ 'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas', 'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation', 'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily', 'forbes', + 'time', ] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/time.py b/src/calibre/web/feeds/recipes/time.py new file mode 100644 index 0000000000..17df0c32e9 --- /dev/null +++ b/src/calibre/web/feeds/recipes/time.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +time.com +''' + +from calibre.ebooks.BeautifulSoup import BeautifulSoup +from calibre.web.feeds.news import BasicNewsRecipe + +class Time(BasicNewsRecipe): + title = u'Time' + __author__ = 'Darko Miletic' + description = 'Weekly magazine' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = False + use_embedded_content = False + + cover_url = 'http://img.timeinc.net/time/rd/trunk/www/web/feds/i/logo_time_home.gif' + + keep_only_tags = [dict(name='div', attrs={'class':'tout1'})] + + feeds = [ + (u'Top Stories', u'http://feedproxy.google.com/time/topstories') + ,(u'Nation', u'http://feedproxy.google.com/time/nation') + ,(u'Business & Tech', u'http://feedproxy.google.com/time/business') + ,(u'Science & Tech', u'http://feedproxy.google.com/time/scienceandhealth') + ,(u'World', u'http://feedproxy.google.com/time/world') + ,(u'Entertainment', u'http://feedproxy.google.com/time/entertainment') + ,(u'Politics', u'http://feedproxy.google.com/time/politics') + ,(u'Travel', u'http://feedproxy.google.com/time/travel') + ] + + def print_version(self, url): + raw = self.browser.open(url).read() + soup = BeautifulSoup(raw.decode('utf8', 'replace')) + print_link = soup.find('a', {'id':'prt'}) + if print_link is None: + return '' + return 'http://www.time.com' + print_link['href']