diff --git a/src/calibre/gui2/images/news/24sata.png b/src/calibre/gui2/images/news/24sata.png new file mode 100644 index 0000000000..a1ff893670 Binary files /dev/null and b/src/calibre/gui2/images/news/24sata.png differ diff --git a/src/calibre/gui2/images/news/nacional_cro.png b/src/calibre/gui2/images/news/nacional_cro.png new file mode 100644 index 0000000000..5e326122e3 Binary files /dev/null and b/src/calibre/gui2/images/news/nacional_cro.png differ diff --git a/src/calibre/gui2/images/news/vecernji_list.png b/src/calibre/gui2/images/news/vecernji_list.png new file mode 100644 index 0000000000..eb900431af Binary files /dev/null and b/src/calibre/gui2/images/news/vecernji_list.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 1ac26c391f..0d1b72b9ca 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -35,7 +35,8 @@ recipe_modules = ['recipe_' + r for r in ( 'lamujerdemivida', 'soldiers', 'theonion', 'news_times', 'el_universal', 'mediapart', 'wikinews_en', 'ecogeek', 'daily_mail', 'new_york_review_of_books_no_sub', 'politico', 'adventuregamers', - 'mondedurable', 'instapaper', + 'mondedurable', 'instapaper', 'dnevnik_cro', 'vecernji_list', + 'nacional_cro', '24sata', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_24sata.py b/src/calibre/web/feeds/recipes/recipe_24sata.py new file mode 100644 index 0000000000..004e7ff5e6 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_24sata.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +24sata.hr +''' + +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class Cro24Sata(BasicNewsRecipe): + title = '24 Sata - Hr' + __author__ = 'Darko Miletic' + description = "News Portal from Croatia" + publisher = '24sata.hr' + category = 'news, politics, Croatia' + oldest_article = 2 + max_articles_per_feed = 100 + delay = 4 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + remove_javascript = True + language = _('Croatian') + + 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 + '"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + remove_tags = [ + dict(name=['object','link','embed']) + ,dict(name='table', attrs={'class':'enumbox'}) + ] + + feeds = [(u'Najnovije Vijesti', u'http://www.24sata.hr/index.php?cmd=show_rss&action=novo')] + + def preprocess_html(self, soup): + soup.html['lang'] = 'hr-HR' + mtag = '\n' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + return soup + + def print_version(self, url): + return url + '&action=ispis' + \ No newline at end of file diff --git a/src/calibre/web/feeds/recipes/recipe_dnevnik_cro.py b/src/calibre/web/feeds/recipes/recipe_dnevnik_cro.py new file mode 100644 index 0000000000..ada5ea22d5 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_dnevnik_cro.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +dnevnik.hr +''' + +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class DnevnikCro(BasicNewsRecipe): + title = 'Dnevnik - Hr' + __author__ = 'Darko Miletic' + description = "Vijesti iz Hrvatske" + publisher = 'Dnevnik.hr' + category = 'news, politics, Croatia' + oldest_article = 2 + max_articles_per_feed = 100 + delay = 4 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + remove_javascript = True + language = _('Croatian') + + 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')] + + keep_only_tags = [dict(name='div', attrs={'id':'article'})] + + remove_tags = [ + dict(name=['object','link','embed']) + ,dict(name='div', attrs={'class':'menu'}) + ,dict(name='div', attrs={'id':'video'}) + ] + + remove_tags_after = dict(name='div', attrs={'id':'content'}) + + feeds = [(u'Vijesti', u'http://rss.dnevnik.hr/index.rss')] + + def preprocess_html(self, soup): + soup.html['lang'] = 'hr-HR' + mtag = '\n' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + return soup + diff --git a/src/calibre/web/feeds/recipes/recipe_nacional_cro.py b/src/calibre/web/feeds/recipes/recipe_nacional_cro.py new file mode 100644 index 0000000000..bbb0112ceb --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_nacional_cro.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +nacional.hr +''' + +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class NacionalCro(BasicNewsRecipe): + title = 'Nacional - Hr' + __author__ = 'Darko Miletic' + description = "news from Croatia" + publisher = 'Nacional.hr' + category = 'news, politics, Croatia' + oldest_article = 2 + max_articles_per_feed = 100 + delay = 4 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + remove_javascript = True + language = _('Croatian') + + 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 + '"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + remove_tags = [dict(name=['object','link','embed'])] + + feeds = [(u'Najnovije Vijesti', u'http://www.nacional.hr/rss')] + + def preprocess_html(self, soup): + soup.html['lang'] = 'hr-HR' + mtag = '\n' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + return soup + + def print_version(self, url): + rest, sep, disc = url.rpartition('/') + return rest.replace('/clanak/','/clanak/print/') + \ No newline at end of file diff --git a/src/calibre/web/feeds/recipes/recipe_vecernji_list.py b/src/calibre/web/feeds/recipes/recipe_vecernji_list.py new file mode 100644 index 0000000000..b34c49d9fa --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_vecernji_list.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +www.vecernji.hr +''' + +import re +from calibre.web.feeds.recipes import BasicNewsRecipe + +class VecernjiList(BasicNewsRecipe): + title = 'Vecernji List' + __author__ = 'Darko Miletic' + description = "Vecernji.hr je vodeci hrvatski news portal. Cilj je biti prvi u objavljivanju svih vijesti iz Hrvatske, svijeta, sporta, gospodarstva, showbiza i jos mnogo vise. Uz cjelodnevni rad, novinari objavljuju preko 300 raznih vijesti svakoga dana. Vecernji.hr prati sve vaznije dogadaje specijalnim izvjestajima, video specijalima i foto galerijama." + publisher = 'Vecernji.hr' + category = 'news, politics, Croatia' + oldest_article = 2 + max_articles_per_feed = 100 + delay = 4 + no_stylesheets = True + encoding = 'utf-8' + use_embedded_content = False + remove_javascript = True + language = _('Croatian') + + 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')] + + remove_tags = [ + dict(name=['object','link','embed']) + ,dict(name='table', attrs={'class':'enumbox'}) + ] + + feeds = [(u'Vijesti', u'http://www.vecernji.hr/rss/')] + + def preprocess_html(self, soup): + soup.html['lang'] = 'hr-HR' + mtag = '\n' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + return soup + + def print_version(self, url): + return url.replace('/index.do','/print.do') + \ No newline at end of file