Merge upstream changes.

This commit is contained in:
Marshall T. Vandegrift 2008-12-21 23:33:08 -05:00
commit a14d00db54
7 changed files with 116 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 763 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

View File

@ -18,7 +18,8 @@ recipe_modules = [
'nytimes_sub', 'security_watch', 'cyberpresse', 'st_petersburg_times', 'nytimes_sub', 'security_watch', 'cyberpresse', 'st_petersburg_times',
'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas', 'clarin', 'financial_times', 'heise', 'le_monde', 'harpers', 'science_aas',
'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation', 'science_news', 'the_nation', 'lrb', 'harpers_full', 'liberation',
'linux_magazine', 'telegraph_uk', 'utne', 'linux_magazine', 'telegraph_uk', 'utne', 'sciencedaily', 'forbes',
'time',
] ]
import re, imp, inspect, time, os import re, imp, inspect, time, os

View File

@ -0,0 +1,37 @@
from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe
class Forbes(BasicNewsRecipe):
title = u'Forbes'
description = 'Business and Financial News'
__author__ = 'Darko Miletic'
oldest_article = 30
max_articles_per_feed = 100
no_stylesheets = True
html2lrf_options = ['--base-font-size', '10']
cover_url = u'http://www.forbes.com/media/current_covers/forbes_120_160.gif'
feeds = [(u'Latest', u'http://www.forbes.com/news/index.xml'),
(u'Most Popular', u'http://www.forbes.com/feeds/popstories.xml'),
(u'Most Emailed', u'http://www.forbes.com/feeds/mostemailed.xml'),
(u'Faces', u'http://www.forbes.com/facesscan/index.xml'),
(u'Technology', u'http://www.forbes.com/technology/index.xml'),
(u'Personal Tech', u'http://www.forbes.com/personaltech/index.xml'),
(u'Wireless', u'http://www.forbes.com/wireless/index.xml'),
(u'Business', u'http://www.forbes.com/business/index.xml'),
(u'Sports Money', u'http://www.forbes.com/sportsmoney/index.xml'),
(u'Sports', u'http://www.forbes.com/forbeslife/sports/index.xml'),
(u'Vehicles', u'http://www.forbes.com/forbeslife/vehicles/index.xml'),
(u'Leadership', u'http://www.forbes.com/leadership/index.xml'),
(u'Careers', u'http://www.forbes.com/leadership/careers/index.xml'),
(u'Compensation', u'http://www.forbes.com/leadership/compensation/index.xml'),
(u'Managing', u'http://www.forbes.com/leadership/managing/index.xml')]
def print_version(self, url):
raw = self.browser.open(url).read()
soup = BeautifulSoup(raw.decode('latin1', 'replace'))
print_link = soup.find('a', {'onclick':"s_linkTrackVars='prop18';s_linkType='o';s_linkName='Print';if(typeof(globalPageName)!='undefined')s_prop18=globalPageName;s_lnk=s_co(this);s_gs(s_account);"})
if print_link is None:
return ''
return 'http://www.forbes.com' + print_link['href']

View File

@ -0,0 +1,32 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
'''
sciencedaily.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class ScienceDaily(BasicNewsRecipe):
title = u'ScienceDaily'
__author__ = u'Darko Miletic'
description = u"Breaking science news and articles on global warming, extrasolar planets, stem cells, bird flu, autism, nanotechnology, dinosaurs, evolution -- the latest discoveries in astronomy, anthropology, biology, chemistry, climate &amp; environment, computers, engineering, health &amp; medicine, math, physics, psychology, technology, and more -- from the world's leading universities and research organizations."
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
cover_url = 'http://www.sciencedaily.com/images/logo.gif'
keep_only_tags = [
dict(name='h1', attrs={'class':'story'})
,dict(name='div', attrs={'id':'story'})
]
remove_tags_after = dict(name='div', attrs={'id':'citationbox'})
remove_tags = [
dict(name='div', attrs={'id':'seealso'})
,dict(name='div', attrs={'id':'citationbox'})
]
feeds = [(u"ScienceDaily", u'http://www.sciencedaily.com/newsfeed.xml')]

View 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']