| 1 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 2 |
|
| 3 |
|
| 4 |
class AdvancedUserRecipe1271637235(BasicNewsRecipe): |
| 5 |
title = 'Thairath' |
| 6 |
__author__ = 'Anat R.' |
| 7 |
language = 'th' |
| 8 |
|
| 9 |
oldest_article = 7 |
| 10 |
|
| 11 |
max_articles_per_feed = 100 |
| 12 |
no_stylesheets = True |
| 13 |
|
| 14 |
remove_javascript = True |
| 15 |
|
| 16 |
use_embedded_content = False |
| 17 |
feeds = [ |
| 18 |
('News', 'http://www.thairath.co.th/rss/news.xml'), |
| 19 |
('Politics', 'http://www.thairath.co.th/rss/pol.xml'), |
| 20 |
('Economy', 'http://www.thairath.co.th/rss/eco.xml'), |
| 21 |
('International', 'http://www.thairath.co.th/rss/oversea.xml'), |
| 22 |
('Sports', 'http://www.thairath.co.th/rss/sport.xml'), |
| 23 |
('Life', 'http://www.thairath.co.th/rss/life.xml'), |
| 24 |
('Education', 'http://www.thairath.co.th/rss/edu.xml'), |
| 25 |
('Tech', 'http://www.thairath.co..th/rss/tech.xml'), |
| 26 |
('Entertainment', 'http://www.thairath.co.th/rss/ent.xml'), |
| 27 |
] |
| 28 |
keep_only_tags = [] |
| 29 |
|
| 30 |
keep_only_tags.append(dict(name='h1', attrs={'id': 'title'})) |
| 31 |
|
| 32 |
keep_only_tags.append(dict(name='ul', attrs={'class': 'detail-info'})) |
| 33 |
|
| 34 |
keep_only_tags.append(dict(name='img', attrs={'class': 'detail-image'})) |
| 35 |
|
| 36 |
keep_only_tags.append(dict(name='div', attrs={'class': 'entry'})) |
| 37 |
remove_tags = [] |
| 38 |
remove_tags.append(dict(name='div', attrs={'id': 'menu-holder'})) |
| 39 |
|
| 40 |
remove_tags.append(dict(name='div', attrs={'class': 'addthis_toolbox addthis_default_style'})) |
| 41 |
|
| 42 |
remove_tags.append(dict(name='div', attrs={'class': 'box top-item'})) |
| 43 |
|
| 44 |
remove_tags.append(dict(name='div', attrs={'class': 'column-200 column-margin-430'})) |
| 45 |
|
| 46 |
remove_tags.append(dict(name='div', attrs={'id': 'detail-related'})) |
| 47 |
|
| 48 |
remove_tags.append(dict(name='div', attrs={'id': 'related'})) |
| 49 |
|
| 50 |
remove_tags.append(dict(name='id', attrs={'class': 'footer'})) |
| 51 |
|
| 52 |
remove_tags.append(dict(name='ul', attrs={'id': 'banner-highlights-images'})) |