1 2from calibre.web.feeds.news import BasicNewsRecipe 3 4 5class Neowin(BasicNewsRecipe): 6 title = u'Neowin.net' 7 oldest_article = 5 8 language = 'en' 9 description = 'News from IT' 10 publisher = 'Neowin' 11 category = 'news, IT, Microsoft, Apple, hardware, software, games' 12 __author__ = 'Darko Miletic' 13 max_articles_per_feed = 100 14 no_stylesheets = True 15 encoding = 'utf8' 16 17 conversion_options = { 18 'tags': category, 'language': language, 'comments': description, 'publisher': publisher 19 } 20 21 keep_only_tags = [dict(name='div', attrs={'id': 'article'})] 22 remove_tags_after = dict(name='div', attrs={'id': 'tag-bar'}) 23 24 remove_tags = [ 25 dict(name=['base', 'object', 'link', 'iframe']), dict( 26 name='div', attrs={'id': 'tag-bar'}) 27 ] 28 29 feeds = [ 30 31 (u'Software', u'http://www.neowin.net/news/rss/software'), 32 (u'Gaming', u'http://www.neowin.net/news/rss/gaming'), 33 (u'Microsoft', u'http://www.neowin.net/news/rss/microsoft'), 34 (u'Apple', u'http://www.neowin.net/news/rss/apple'), 35 (u'Editorial', u'http://www.neowin.net/news/rss/editorial') 36 ] 37 38 def image_url_processor(cls, baseurl, url): 39 return url 40