From 05aa76c149abc26ca3dcc8109d0d03d2ebc8444b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 16 Jun 2010 09:05:49 -0600 Subject: [PATCH] Fix #5849 (New recipe for serbian Magazine Akter) --- resources/images/news/akter.png | Bin 0 -> 429 bytes resources/recipes/akter.recipe | 78 ++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 resources/images/news/akter.png create mode 100644 resources/recipes/akter.recipe diff --git a/resources/images/news/akter.png b/resources/images/news/akter.png new file mode 100644 index 0000000000000000000000000000000000000000..60c352849e53a65097ebdbd45febc8fbb049835e GIT binary patch literal 429 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b zK-vS0-A-oPfdtD69Mgd`SU*F|v9*VRoNJygjv*GOmj)l?JZ!*Y)0&{MWQl$LMcz%W z;jhKy6#n}?PG2ansQ+j{&UMktnj$Xw&S^@ra+P?(b^{+QXrZ_zrrV+&uIT21Glwqr#b z2gCKthQePKCtnpfeee64V2fjo>lV0v`KTNFCGGvnTEqK)=ZoEI`=LEA`+nAJv6b(x z1AVAk;u=wsl30>zm0Xkxq!^403=MP*%ybRSLJTae3{0$yEPz}q0|R@Jl}0EUa`RI% i(<+fQ7#dg^7+V>cKr|Gt@0JB>VDNPHb6Mw<&;$Tr44T^j literal 0 HcmV?d00001 diff --git a/resources/recipes/akter.recipe b/resources/recipes/akter.recipe new file mode 100644 index 0000000000..3959fff717 --- /dev/null +++ b/resources/recipes/akter.recipe @@ -0,0 +1,78 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +akter.co.rs +''' + +import re +from calibre.web.feeds.news import BasicNewsRecipe + +class Akter(BasicNewsRecipe): + title = 'AKTER' + __author__ = 'Darko Miletic' + description = 'AKTER - nedeljni politicki magazin savremene Srbije' + publisher = 'Akter Media Group d.o.o.' + category = 'vesti, online vesti, najnovije vesti, politika, sport, ekonomija, biznis, finansije, berza, kultura, zivot, putovanja, auto, automobili, tehnologija, politicki magazin, dogadjaji, desavanja, lifestyle, zdravlje, zdravstvo, vest, novine, nedeljnik, srbija, novi sad, vojvodina, svet, drustvo, zabava, republika srpska, beograd, intervju, komentar, reportaza, arhiva vesti, news, serbia, politics' + oldest_article = 8 + max_articles_per_feed = 100 + no_stylesheets = False + use_embedded_content = False + encoding = 'utf-8' + masthead_url = 'http://www.akter.co.rs/templates/gk_thenews2/images/style2/logo.png' + language = 'sr' + publication_type = 'magazine' + remove_empty_feeds = True + PREFIX = 'http://www.akter.co.rs' + 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)} + .article_description,body,.lokacija{font-family: Arial,Helvetica,sans1,sans-serif} + .color-2{display:block; margin-bottom: 10px; padding: 5px, 10px; + border-left: 1px solid #D00000; color: #D00000} + img{margin-bottom: 0.8em} """ + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + , 'linearize_tables' : True + } + + preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')] + + feeds = [ + (u'Politika' , u'http://www.akter.co.rs/index.php/politikaprint.html' ) + ,(u'Ekonomija' , u'http://www.akter.co.rs/index.php/ekonomijaprint.html') + ,(u'Life&Style' , u'http://www.akter.co.rs/index.php/lsprint.html' ) + ,(u'Sport' , u'http://www.akter.co.rs/index.php/sportprint.html' ) + ] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return self.adeify_images(soup) + + def print_version(self, url): + return url + '?tmpl=component&print=1&page=' + + def parse_index(self): + totalfeeds = [] + lfeeds = self.get_feeds() + for feedobj in lfeeds: + feedtitle, feedurl = feedobj + self.report_progress(0, _('Fetching feed')+' %s...'%(feedtitle if feedtitle else feedurl)) + articles = [] + soup = self.index_to_soup(feedurl) + for item in soup.findAll(attrs={'class':['sectiontableentry1','sectiontableentry2']}): + link = item.find('a') + url = self.PREFIX + link['href'] + title = self.tag_to_string(link) + articles.append({ + 'title' :title + ,'date' :'' + ,'url' :url + ,'description':'' + }) + totalfeeds.append((feedtitle, articles)) + return totalfeeds +