diff --git a/src/calibre/gui2/images/news/e_novine.png b/src/calibre/gui2/images/news/e_novine.png new file mode 100644 index 0000000000..285e1e6a4d Binary files /dev/null and b/src/calibre/gui2/images/news/e_novine.png differ diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 92fbbda555..eed5670cac 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -30,7 +30,8 @@ recipe_modules = ['recipe_' + r for r in ( 'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna', 'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices', 'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline', - 'la_republica', 'physics_today', 'chicago_tribune', + 'la_republica', 'physics_today', 'chicago_tribune', 'e_novine', + 'al_jazeera', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_al_jazeera.py b/src/calibre/web/feeds/recipes/recipe_al_jazeera.py new file mode 100644 index 0000000000..9923f00392 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_al_jazeera.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +aljazeera.net +''' +from calibre.web.feeds.news import BasicNewsRecipe + +class AlJazeera(BasicNewsRecipe): + title = 'Al Jazeera in English' + __author__ = 'Darko Miletic' + description = 'News from Middle East' + publisher = 'Al Jazeera' + category = 'news, politics, middle east' + simultaneous_downloads = 1 + delay = 4 + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'iso-8859-1' + remove_javascript = True + use_embedded_content = False + + html2lrf_options = [ + '--comment', description + , '--category', category + , '--publisher', publisher + , '--ignore-tables' + ] + + html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"\nlinearize_table=True' + + keep_only_tags = [dict(name='div', attrs={'id':'ctl00_divContent'})] + + remove_tags = [ + dict(name=['object','link']) + ,dict(name='td', attrs={'class':['MostActiveDescHeader','MostActiveDescBody']}) + ] + + feeds = [(u'AL JAZEERA ENGLISH (AJE)', u'http://english.aljazeera.net/Services/Rss/?PostingId=2007731105943979989' )] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + for item in soup.findAll(face=True): + del item['face'] + return soup + diff --git a/src/calibre/web/feeds/recipes/recipe_e_novine.py b/src/calibre/web/feeds/recipes/recipe_e_novine.py new file mode 100644 index 0000000000..83654fe4c8 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_e_novine.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2009, Darko Miletic ' + +''' +e-novine.com +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class E_novine(BasicNewsRecipe): + title = 'E-Novine' + __author__ = 'Darko Miletic' + description = 'News from Serbia' + publisher = 'E-novine' + category = 'news, politics, Balcans' + oldest_article = 1 + max_articles_per_feed = 100 + no_stylesheets = True + encoding = 'cp1250' + cover_url = 'http://www.e-novine.com/slike/slike_3/r1/g2008/m03/y3165525326702598.jpg' + remove_javascript = True + use_embedded_content = False + language = _('Serbian') + extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{text-align: justify; font-family: serif1, serif} .article_description{font-family: sans1, sans-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} img {margin-top: 0em; margin-bottom: 0.4em}"' + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + keep_only_tags = [dict(name='div', attrs={'id':['css_47_0_2844H']})] + + remove_tags = [dict(name=['object','link','embed','iframe'])] + + feeds = [(u'Sve vesti', u'http://www.e-novine.com/rss/e-novine.xml' )] + + def preprocess_html(self, soup): + soup.html['xml:lang'] = 'sr-Latn-ME' + soup.html['lang'] = 'sr-Latn-ME' + mtag = '' + soup.head.insert(0,mtag) + for item in soup.findAll(style=True): + del item['style'] + ftag = soup.find('div', attrs={'id':'css_47_0_2844H'}) + if ftag: + it = ftag.div + it.extract() + ftag.div.extract() + ftag.insert(0,it) + return soup diff --git a/upload.py b/upload.py index 2aeb1461ee..cab426b191 100644 --- a/upload.py +++ b/upload.py @@ -676,7 +676,7 @@ class stage3(OptionlessCommand): def run(self): OptionlessCommand.run(self) - self.misc() + self.misc() class stage2(OptionlessCommand): description = 'Stage 2 of the build process' @@ -705,4 +705,4 @@ class upload(OptionlessCommand): ('stage1', None), ('stage2', None), ('stage3', None) - ] \ No newline at end of file + ]