diff --git a/src/calibre/gui2/images/news/24sata_rs.png b/src/calibre/gui2/images/news/24sata_rs.png new file mode 100644 index 0000000000..21736bd8f9 Binary files /dev/null and b/src/calibre/gui2/images/news/24sata_rs.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index d9d63ea0d3..0cb80ec192 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -36,7 +36,7 @@ recipe_modules = ['recipe_' + r for r in ( 'el_universal', 'mediapart', 'wikinews_en', 'ecogeek', 'daily_mail', 'new_york_review_of_books_no_sub', 'politico', 'adventuregamers', 'mondedurable', 'instapaper', 'dnevnik_cro', 'vecernji_list', - 'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', + 'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', '24sata_rs', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_24sata_rs.py b/src/calibre/web/feeds/recipes/recipe_24sata_rs.py new file mode 100644 index 0000000000..ac4ee2b860 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_24sata_rs.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +24sata.rs +''' + +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class Ser24Sata(BasicNewsRecipe): + title = '24 Sata - Sr' + __author__ = 'Darko Miletic' + description = '24 sata portal vesti iz Srbije' + publisher = 'Ringier d.o.o.' + category = 'news, politics, entertainment, Serbia' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + remove_javascript = True + language = _('Serbian') + + extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}' + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + , '--ignore-tables' + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_tables=True' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [(u'Vesti Dana', u'http://www.24sata.rs/rss.php')] + + def preprocess_html(self, soup): + soup.html['xml:lang'] = 'sr-Latn-RS' + soup.html['lang'] = 'sr-Latn-RS' + mtag = '\n' + soup.head.insert(0,mtag) + return soup + + def print_version(self, url): + article, sep, rest = url.partition('#') + return article.replace('/show.php','/_print.php') +