calibre/recipes/nationalgeoro.recipe

49 lines
1.5 KiB
Plaintext

# -*- coding: utf-8 -*-
#!/usr/bin/env python
__license__ = 'GPL v3'
__copyright__ = u'2011, Silviu Cotoar\u0103'
'''
natgeo.ro
'''
from calibre.web.feeds.news import BasicNewsRecipe
class NationalGeoRo(BasicNewsRecipe):
title = u'National Geographic RO'
__author__ = u'Silviu Cotoar\u0103'
description = u'S\u0103 avem grij\u0103 de planet\u0103'
publisher = 'National Geographic'
oldest_article = 35
language = 'ro'
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
category = 'Reviste'
encoding = 'utf-8'
cover_url = 'http://wiki.benecke.com/images/c/c4/NatGeographic_Logo.jpg'
conversion_options = {
'comments' : description
,'tags' : category
,'language' : language
,'publisher' : publisher
}
keep_only_tags = [
dict(name='h2', attrs={'class':'contentheading clearfix'})
, dict(name='div', attrs={'class':'article-content'})
]
remove_tags = [
dict(name='div', attrs={'class':['phocagallery']})
]
feeds = [
(u'Feeds', u'http://www.natgeo.ro/index.php?format=feed&type=rss')
]
def preprocess_html(self, soup):
return self.adeify_images(soup)