diff --git a/resources/images/news/njuz_net.png b/resources/images/news/njuz_net.png new file mode 100644 index 0000000000..86f2f77e17 Binary files /dev/null and b/resources/images/news/njuz_net.png differ diff --git a/resources/recipes/njuz_net.recipe b/resources/recipes/njuz_net.recipe new file mode 100644 index 0000000000..23069d7604 --- /dev/null +++ b/resources/recipes/njuz_net.recipe @@ -0,0 +1,61 @@ + +__license__ = 'GPL v3' +__copyright__ = '2011, Darko Miletic ' +''' +njuz.net +''' +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class NjuzNet(BasicNewsRecipe): + title = 'Njuz.net' + __author__ = 'Darko Miletic' + description = 'Iscasene vesti iz Srbije, regiona i sveta' + publisher = 'njuz.net' + category = 'news, politics, humor, Serbia' + oldest_article = 2 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'utf8' + language = 'sr' + publication_type = 'newsportal' + masthead_url = 'http://www.njuz.net/njuznet.jpg' + extra_css = """ + @font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} + body{font-family: serif1, serif} + .articledescription{font-family: serif1, serif} + .wp-caption-text{font-size: x-small} + """ + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + keep_only_tags = [ + dict(attrs={'id':'entryMeta'}) + ,dict(attrs={'class':'post'}) + ] + + remove_tags = [ + dict(name=['embed','link','base','iframe','object','meta','fb:like']) + ,dict(name='div', attrs={'id':'tagsandcats'}) + ] + remove_tags_after= dict(name='div', attrs={'id':'tagsandcats'}) + remove_attributes= ['lang'] + feeds = [(u'Clanci', u'http://www.njuz.net/feed/')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + for alink in soup.findAll('a'): + if alink.string is not None: + tstr = alink.string + alink.replaceWith(tstr) + return soup +