diff --git a/src/calibre/gui2/images/news/krstarica.png b/src/calibre/gui2/images/news/krstarica.png new file mode 100644 index 0000000000..92eecfc4e0 Binary files /dev/null and b/src/calibre/gui2/images/news/krstarica.png differ diff --git a/src/calibre/gui2/images/news/krstarica_en.png b/src/calibre/gui2/images/news/krstarica_en.png new file mode 100644 index 0000000000..92eecfc4e0 Binary files /dev/null and b/src/calibre/gui2/images/news/krstarica_en.png differ diff --git a/src/calibre/gui2/images/news/tanjug.png b/src/calibre/gui2/images/news/tanjug.png new file mode 100644 index 0000000000..be1128073c Binary files /dev/null and b/src/calibre/gui2/images/news/tanjug.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 0cb80ec192..d407378ce5 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -37,6 +37,7 @@ recipe_modules = ['recipe_' + r for r in ( 'new_york_review_of_books_no_sub', 'politico', 'adventuregamers', 'mondedurable', 'instapaper', 'dnevnik_cro', 'vecernji_list', 'nacional_cro', '24sata', 'dnevni_avaz', 'glas_srpske', '24sata_rs', + 'krstarica', 'krstarica_en', 'tanjug', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_krstarica.py b/src/calibre/web/feeds/recipes/recipe_krstarica.py new file mode 100644 index 0000000000..fb25ae8d84 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_krstarica.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +vesti.krstarica.com +''' +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class Krstarica(BasicNewsRecipe): + title = 'Krstarica - Vesti' + __author__ = 'Darko Miletic' + description = 'Dnevne vesti iz Srbije i sveta' + publisher = 'Krstarica' + category = 'news, politics, Serbia' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + remove_javascript = True + encoding = 'utf-8' + 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 + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em}"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [ + (u'Vesti dana' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=aktuelno&lang=0' ) + ,(u'Srbija' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=scg&lang=0' ) + ,(u'Svet' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=svet&lang=0' ) + ,(u'Politika' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=politika&lang=0' ) + ,(u'Ekonomija' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=ekonomija&lang=0' ) + ,(u'Drustvo' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=drustvo&lang=0' ) + ,(u'Kultura' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=kultura&lang=0' ) + ,(u'Nauka i Tehnologija', u'http://vesti.krstarica.com/index.php?rss=1&rubrika=nauka&lang=0' ) + ,(u'Medicina' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=medicina&lang=0' ) + ,(u'Sport' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=sport&lang=0' ) + ,(u'Zanimljivosti' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=zanimljivosti&lang=0') + ] + + def preprocess_html(self, soup): + mtag = '' + soup.head.insert(0,mtag) + titletag = soup.find('h4') + if titletag: + realtag = titletag.parent.parent + realtag.extract() + for item in soup.findAll(['table','center']): + item.extract() + soup.body.insert(1,realtag) + realtag.name = 'div' + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll(align=True): + del item['align'] + return soup diff --git a/src/calibre/web/feeds/recipes/recipe_krstarica_en.py b/src/calibre/web/feeds/recipes/recipe_krstarica_en.py new file mode 100644 index 0000000000..e426e7d807 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_krstarica_en.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +vesti.krstarica.com +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Krstarica_en(BasicNewsRecipe): + title = 'Krstarica - news in english' + __author__ = 'Darko Miletic' + description = 'News from Serbia and world' + publisher = 'Krstarica' + category = 'news, politics, Serbia' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + remove_javascript = True + encoding = 'utf-8' + language = _('English') + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em}"' + + feeds = [ + (u'Daily news', u'http://vesti.krstarica.com/index.php?rss=1&rubrika=aktuelno&lang=1' ) + ,(u'Serbia' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=scg&lang=1' ) + ,(u'Politics' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=politika&lang=1' ) + ,(u'Economy' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=ekonomija&lang=1' ) + ,(u'Culture' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=kultura&lang=1' ) + ,(u'Sports' , u'http://vesti.krstarica.com/index.php?rss=1&rubrika=sport&lang=1' ) + ] + + def preprocess_html(self, soup): + mtag = '' + soup.head.insert(0,mtag) + titletag = soup.find('h4') + if titletag: + realtag = titletag.parent.parent + realtag.extract() + for item in soup.findAll(['table','center']): + item.extract() + soup.body.insert(1,realtag) + realtag.name = 'div' + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll(align=True): + del item['align'] + return soup diff --git a/src/calibre/web/feeds/recipes/recipe_tanjug.py b/src/calibre/web/feeds/recipes/recipe_tanjug.py new file mode 100644 index 0000000000..9a8acfaca7 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_tanjug.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' +''' +tanjug.rs +''' +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class Tanjug(BasicNewsRecipe): + title = 'Tanjug' + __author__ = 'Darko Miletic' + description = 'Novinska agencija TANJUG - Dnevne vesti iz Srbije i sveta' + publisher = 'Tanjug' + category = 'news, politics, Serbia' + oldest_article = 1 + max_articles_per_feed = 100 + use_embedded_content = True + encoding = 'utf-8' + lang = 'sr-Latn-RS' + 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 + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\noverride_css=" p {text-indent: 0em; margin-top: 0em; margin-bottom: 0.5em}"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [(u'Vesti', u'http://www.tanjug.rs/StaticPages/RssTanjug.aspx')] + + def preprocess_html(self, soup): + soup.html['xml:lang'] = self.lang + soup.html['lang' ] = self.lang + soup.html['dir' ] = "ltr" + mtag = '' + soup.head.insert(0,mtag) + return soup