| 1 |
__license__ = 'GPL v3' |
| 2 |
__copyright__ = '2011, Seongkyoun Yoo <seongkyoun.yoo at gmail.com>' |
| 3 |
''' |
| 4 |
Profile to download The Hankyoreh |
| 5 |
''' |
| 6 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 7 |
|
| 8 |
|
| 9 |
class Hankyoreh21(BasicNewsRecipe): |
| 10 |
title = 'Hankyoreh21' |
| 11 |
language = 'ko' |
| 12 |
description = 'The Hankyoreh21 Magazine articles' |
| 13 |
__author__ = 'Seongkyoun Yoo' |
| 14 |
oldest_article = 30 |
| 15 |
max_articles_per_feed = 10 |
| 16 |
no_stylesheets = True |
| 17 |
remove_javascript = True |
| 18 |
keep_only_tags = [ |
| 19 |
dict(name='header', attrs={'class': ['article_head']}), |
| 20 |
dict(name='div', attrs={'class': ['article_body']}), |
| 21 |
] |
| 22 |
remove_tags = [ |
| 23 |
dict(name='div', attrs={'class': ['article_tools']}), |
| 24 |
] |
| 25 |
|
| 26 |
feeds = [ |
| 27 |
# ('전체기사', 'http://h21.hani.co.kr/rss/'), |
| 28 |
('표지이야기', 'http://h21.hani.co.kr/rss/cover/'), |
| 29 |
('특집', 'http://h21.hani.co.kr/rss/special/'), |
| 30 |
('정치', 'http://h21.hani.co.kr/rss/politics/'), |
| 31 |
('경제', 'http://h21.hani.co.kr/rss/economy/'), |
| 32 |
('사회', 'http://h21.hani.co.kr/rss/society/'), |
| 33 |
('세계', 'http://h21.hani.co.kr/rss/world/'), |
| 34 |
('문화', 'http://h21.hani.co.kr/rss/culture/'), |
| 35 |
] |
| 36 |
|
| 37 |
def get_article_url(self, article): |
| 38 |
org_url = BasicNewsRecipe.get_article_url(self, article) |
| 39 |
return 'http://h21.hani.co.kr' + org_url if org_url[0] == '/' else org_url |