| 1 |
__license__ = 'GPL v3' |
| 2 |
__copyright__ = '2010, Walt Anthony <workshop.northpole at gmail.com>' |
| 3 |
''' |
| 4 |
www.hotair.com |
| 5 |
''' |
| 6 |
|
| 7 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 8 |
|
| 9 |
|
| 10 |
def classes(classes): |
| 11 |
q = frozenset(classes.split(' ')) |
| 12 |
return dict(attrs={'class': lambda x: x and frozenset(x.split()).intersection(q)}) |
| 13 |
|
| 14 |
|
| 15 |
class hotair(BasicNewsRecipe): |
| 16 |
title = 'Hot Air' |
| 17 |
__author__ = 'Walt Anthony' |
| 18 |
description = "The world's first, full-service conservative Internet broadcast network" |
| 19 |
publisher = 'Hot Air' |
| 20 |
category = 'news, politics, USA' |
| 21 |
oldest_article = 3 |
| 22 |
max_articles_per_feed = 100 |
| 23 |
summary_length = 150 |
| 24 |
language = 'en' |
| 25 |
encoding = 'utf-8' |
| 26 |
use_embedded_content = False |
| 27 |
remove_javascript = True |
| 28 |
|
| 29 |
conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language} |
| 30 |
|
| 31 |
keep_only_tags = [ |
| 32 |
dict(name='h1'), |
| 33 |
classes('byline article-image article-text'), |
| 34 |
] |
| 35 |
|
| 36 |
remove_tags = [dict(name=['iframe', 'small', 'embed', 'button', 'object', 'link', 'script', 'form'])] |
| 37 |
|
| 38 |
feeds = [('Hot Air', 'http://feeds.feedburner.com/hotair/main'), ('The Greenroom', 'http://feeds2.feedburner.com/hotair/greenroom')] |