mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Recipe for Time (thanks to Darko Miletic)
This commit is contained in:
parent
849c32fa1e
commit
81f2edc740
BIN
src/calibre/gui2/images/news/time.png
Normal file
BIN
src/calibre/gui2/images/news/time.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 282 B |
@ -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
|
||||
|
42
src/calibre/web/feeds/recipes/time.py
Normal file
42
src/calibre/web/feeds/recipes/time.py
Normal file
@ -0,0 +1,42 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
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']
|
Loading…
x
Reference in New Issue
Block a user