calibre/recipes/wired_daily.recipe
2014-03-17 09:16:05 +05:30

46 lines
1.7 KiB
Python

#!/usr/bin/env python
__license__ = 'GPL v3'
__docformat__ = 'restructuredtext en'
from calibre.web.feeds.news import BasicNewsRecipe
class Wired_Daily(BasicNewsRecipe):
title = 'Wired Daily Edition'
__author__ = 'Kovid Goyal'
description = 'Technology news'
timefmt = ' [%Y%b%d %H%M]'
language = 'en'
use_embedded_content = False
no_stylesheets = True
keep_only_tags = [ # dict(name= 'div', id ='liveblog-hdr'),
dict(name='div', attrs={'class': 'post'})]
remove_tags = [dict(name='div', attrs={'class': 'social-top'})]
feeds = [
('Top News', 'http://feeds.wired.com/wired/index'),
('Product Reviews',
'http://www.wired.com/reviews/feeds/latestProductsRss'),
('Autopia', 'http://www.wired.com/autopia/feed/'),
('Danger Room', 'http://www.wired.com/dangerroom/feed/'),
('Epicenter', 'http://www.wired.com/epicenter/feed/'),
('Gadget Lab', 'http://www.wired.com/gadgetlab/feed/'),
('Geek Dad', 'http://www.wired.com/geekdad/feed/'),
('Playbook', 'http://www.wired.com/playbook/feed/'),
('Rawfile', 'http://www.wired.com/rawfile/feed/'),
('This Day in Tech', 'http://www.wired.com/thisdayintech/feed/'),
('Threat Level', 'http://www.wired.com/threatlevel/feed/'),
('Underwire', 'http://www.wired.com/underwire/feed/'),
('Web Monkey', 'http://www.webmonkey.com/feed/'),
('Science', 'http://www.wired.com/wiredscience/feed/'),
]
def preprocess_html(self, soup):
for img in soup.findAll('img', attrs={'data-lazy-src':True}):
img['src'] = img['data-lazy-src']
return soup