diff --git a/resources/images/news/avantaje.png b/resources/images/news/avantaje.png new file mode 100644 index 0000000000..79f83c2665 Binary files /dev/null and b/resources/images/news/avantaje.png differ diff --git a/resources/images/news/onemagazine.png b/resources/images/news/onemagazine.png new file mode 100644 index 0000000000..61ce048c30 Binary files /dev/null and b/resources/images/news/onemagazine.png differ diff --git a/resources/images/news/pcworldro.png b/resources/images/news/pcworldro.png new file mode 100644 index 0000000000..532548302d Binary files /dev/null and b/resources/images/news/pcworldro.png differ diff --git a/resources/images/news/protvmagazin.png b/resources/images/news/protvmagazin.png new file mode 100644 index 0000000000..8824760edb Binary files /dev/null and b/resources/images/news/protvmagazin.png differ diff --git a/resources/images/news/psychologies.png b/resources/images/news/psychologies.png new file mode 100644 index 0000000000..027296dde2 Binary files /dev/null and b/resources/images/news/psychologies.png differ diff --git a/resources/images/news/tvmania.png b/resources/images/news/tvmania.png new file mode 100644 index 0000000000..022267f885 Binary files /dev/null and b/resources/images/news/tvmania.png differ diff --git a/resources/images/news/viva.png b/resources/images/news/viva.png new file mode 100644 index 0000000000..e01fc6125e Binary files /dev/null and b/resources/images/news/viva.png differ diff --git a/resources/recipes/avantaje.recipe b/resources/recipes/avantaje.recipe new file mode 100644 index 0000000000..9a48616fa1 --- /dev/null +++ b/resources/recipes/avantaje.recipe @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +avantaje.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Avantaje(BasicNewsRecipe): + title = u'Avantaje' + __author__ = u'Silviu Cotoar\u0103' + description = u'' + publisher = u'Avantaje' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,Stiri' + encoding = 'utf-8' + cover_url = 'http://www.avantaje.ro/images/default/logo.gif' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + keep_only_tags = [ + dict(name='div', attrs={'id':'articol'}) + , dict(name='div', attrs={'class':'gallery clearfix'}) + , dict(name='div', attrs={'align':'justify'}) + ] + + remove_tags = [ + dict(name='div', attrs={'id':['color_sanatate_box']}) + , dict(name='div', attrs={'class':['nav']}) + , dict(name='div', attrs={'class':['voteaza_art']}) + , dict(name='div', attrs={'class':['bookmark']}) + , dict(name='div', attrs={'class':['links clearfix']}) + , dict(name='div', attrs={'class':['title']}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':['title']}) + ] + + feeds = [ + (u'Feeds', u'http://feeds.feedburner.com/Avantaje') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/onemagazine.recipe b/resources/recipes/onemagazine.recipe new file mode 100644 index 0000000000..73dd50141a --- /dev/null +++ b/resources/recipes/onemagazine.recipe @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +onemagazine.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Onemagazine(BasicNewsRecipe): + title = u'The ONE' + __author__ = u'Silviu Cotoar\u0103' + description = u'Be the ONE, not anyone ..' + publisher = u'The ONE' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,Femei' + encoding = 'utf-8' + cover_url = 'http://www.onemagazine.ro/images/logo_rss.jpg' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'class':'article'}) + , dict(name='div', attrs={'class':'gallery clearfix'}) + , dict(name='div', attrs={'align':'justify'}) + ] + + remove_tags = [ + dict(name='p', attrs={'class':['info']}) + , dict(name='table', attrs={'class':['connect_widget_interactive_area']}) + , dict(name='span', attrs={'class':['photo']}) + , dict(name='div', attrs={'class':['counter']}) + , dict(name='div', attrs={'class':['carousel']}) + , dict(name='div', attrs={'class':['jcarousel-container jcarousel-container-horizontal']}) + ] + + remove_tags_after = [ + dict(name='table', attrs={'class':['connect_widget_interactive_area']}) + ] + + feeds = [ + (u'Feeds', u'http://www.onemagazine.ro/rss') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/pcworldro.recipe b/resources/recipes/pcworldro.recipe new file mode 100644 index 0000000000..89ddbaf21d --- /dev/null +++ b/resources/recipes/pcworldro.recipe @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +pcworld.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Pcworld(BasicNewsRecipe): + title = u'PC World' + __author__ = u'Silviu Cotoar\u0103' + description = u'IT' + publisher = u'PC World' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Stiri,IT' + encoding = 'utf-8' + cover_url = 'http://www.pcworld.ro/img/ui/header-logo.gif' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'id':'content_page'}) + , dict(name='div', attrs={'class':'box_center content_body'}) + ] + + remove_tags = [ + dict(name='h3', attrs={'class':['breadcrumb']}) + , dict(name='div', attrs={'class':['box_center voteaza']}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':['box_center voteaza']}) + ] + + feeds = [ + (u'Feeds', u'http://www.pcworld.ro/contents/pcworld.rss') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/protvmagazin.recipe b/resources/recipes/protvmagazin.recipe new file mode 100644 index 0000000000..fbdb7465fc --- /dev/null +++ b/resources/recipes/protvmagazin.recipe @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +protvmagazin.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Protvmagazin(BasicNewsRecipe): + title = u'ProTv Magazin' + __author__ = u'Silviu Cotoar\u0103' + description = u'Ghid TV' + publisher = u'ProTv Magazin' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,TV' + encoding = 'utf-8' + cover_url = 'http://www.protvmagazin.ro/images/logo.png' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'class':'box gradient'}) + ] + + remove_tags = [ + dict(name='p', attrs={'class':['title']}) + , dict(name='div', attrs={'id':['online_only']}) + , dict(name='div', attrs={'class':['show_article_rating']}) + , dict(name='ul', attrs={'class':['breadcrumbs']}) + , dict(name='p', attrs={'class':['tags']}) + ] + + remove_tags_after = [ + dict(name='table', attrs={'class':['connect_widget_interactive_area']}) + , dict(name='p', attrs={'class':['tags']}) + , dict(name='dev', attrs={'class':['connect_widget_sample_connections clearfix']}) + ] + + feeds = [ + (u'Feeds', u'http://www.protvmagazin.ro/rss/articole-noi') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/psychologies.recipe b/resources/recipes/psychologies.recipe new file mode 100644 index 0000000000..1b69a2ed9e --- /dev/null +++ b/resources/recipes/psychologies.recipe @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +psychologies.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Psychologies(BasicNewsRecipe): + title = u'Psychologies' + __author__ = u'Silviu Cotoar\u0103' + description = u'Psihologie \u015fi Dezvoltare Personal\u0103..' + publisher = u'Psychologies' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,Psihologie' + encoding = 'utf-8' + cover_url = 'http://www.psychologies.ro/images/default/logo.gif' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'class':'nav'}) + , dict(name='div', attrs={'id':'textarticol'}) + + ] + + feeds = [ + (u'Feeds', u'http://feeds.feedburner.com/Psychologies') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/thai_post_daily.recipe b/resources/recipes/thai_post_daily.recipe index 2be17cc37f..4523a9331a 100644 --- a/resources/recipes/thai_post_daily.recipe +++ b/resources/recipes/thai_post_daily.recipe @@ -3,6 +3,7 @@ from calibre.web.feeds.news import BasicNewsRecipe class AdvancedUserRecipe1299054026(BasicNewsRecipe): title = u'Thai Post Daily' __author__ = 'Chotechai P.' + language = 'th' oldest_article = 7 max_articles_per_feed = 100 cover_url = 'http://upload.wikimedia.org/wikipedia/th/1/10/ThaiPost_Logo.png' diff --git a/resources/recipes/tvmania.recipe b/resources/recipes/tvmania.recipe new file mode 100644 index 0000000000..a2d9fcc060 --- /dev/null +++ b/resources/recipes/tvmania.recipe @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +tvmania.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Tvmania(BasicNewsRecipe): + title = u'TVmania' + __author__ = u'Silviu Cotoar\u0103' + description = u'Programe TV' + publisher = u'TVmania' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,TV' + encoding = 'utf-8' + cover_url = 'http://www.tvmania.ro/wp-content/themes/tvmania/images/logo.png' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'class':'articol'}) + , dict(name='font', attrs={'class':'mic'}) + , dict(name='div', attrs={'id':'header_recomandari'}) + , dict(name='div', attrs={'class':'main-image'}) + , dict(name='div', attrs={'id':'articol_recomandare'}) + + ] + + remove_tags = [ + dict(name='div', attrs={'class':['iLikeThis']}) + , dict(name='span', attrs={'class':['tag-links']}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':['iLikeThis']}) + , dict(name='span', attrs={'class':['tag-links']}) + ] + + feeds = [ + (u'Feeds', u'http://www.tvmania.ro/feed') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/recipes/viva.recipe b/resources/recipes/viva.recipe new file mode 100644 index 0000000000..df697ea298 --- /dev/null +++ b/resources/recipes/viva.recipe @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = u'2011, Silviu Cotoar\u0103' +''' +viva.ro +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class Viva(BasicNewsRecipe): + title = u'Viva' + __author__ = u'Silviu Cotoar\u0103' + description = u'Vedete si evenimente' + publisher = u'Viva' + oldest_article = 25 + language = 'ro' + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + category = 'Ziare,Reviste,Femei' + encoding = 'utf-8' + cover_url = 'http://www.viva.ro/images/default/viva.gif' + + conversion_options = { + 'comments' : description + ,'tags' : category + ,'language' : language + ,'publisher' : publisher + } + + extra_css = ''' + h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + .byline {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + .date {font-family:Arial,Helvetica,sans-serif; font-size:xx-small;} + p{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .copyright {font-family:Arial,Helvetica,sans-serif;font-size:xx-small;text-align:center} + .story{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .entry-asset asset hentry{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .pagebody{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .maincontentcontainer{font-family:Arial,Helvetica,sans-serif;font-size:small;} + .story-body{font-family:Arial,Helvetica,sans-serif;font-size:small;} + body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + ''' + + keep_only_tags = [ + dict(name='div', attrs={'class':'articol'}) + , dict(name='div', attrs={'class':'gallery clearfix'}) + , dict(name='div', attrs={'align':'justify'}) + ] + + remove_tags = [ + dict(name='div', attrs={'class':['breadcrumbs']}) + , dict(name='div', attrs={'class':['links clearfix']}) + , dict(name='a', attrs={'id':['img_arrow_right']}) + , dict(name='img', attrs={'id':['zoom']}) + , dict(name='div', attrs={'class':['foto_counter']}) + , dict(name='div', attrs={'class':['gal_select clearfix']}) + ] + + remove_tags_after = [ + dict(name='div', attrs={'class':['links clearfix']}) + ] + + feeds = [ + (u'Vedete', u'http://feeds.feedburner.com/viva-Vedete') + ,(u'Evenimente', u'http://feeds.feedburner.com/viva-Evenimente') + ,(u'Frumusete', u'http://feeds.feedburner.com/viva-Beauty-Fashion') + ,(u'Noutati', u'http://feeds.feedburner.com/viva-Noutati') + ] + + def preprocess_html(self, soup): + return self.adeify_images(soup) diff --git a/resources/template-functions.json b/resources/template-functions.json index fe4379d701..c19627c6c7 100644 --- a/resources/template-functions.json +++ b/resources/template-functions.json @@ -16,6 +16,7 @@ "template": "def evaluate(self, formatter, kwargs, mi, locals, template):\n template = template.replace('[[', '{').replace(']]', '}')\n return formatter.__class__().safe_format(template, kwargs, 'TEMPLATE', mi)\n", "print": "def evaluate(self, formatter, kwargs, mi, locals, *args):\n print args\n return None\n", "titlecase": "def evaluate(self, formatter, kwargs, mi, locals, val):\n return titlecase(val)\n", + "subitems": "def evaluate(self, formatter, kwargs, mi, locals, val, start_index, end_index):\n if not val:\n return ''\n si = int(start_index)\n ei = int(end_index)\n items = [v.strip() for v in val.split(',')]\n rv = set()\n for item in items:\n component = item.split('.')\n try:\n if ei == 0:\n rv.add('.'.join(component[si:]))\n else:\n rv.add('.'.join(component[si:ei]))\n except:\n pass\n return ', '.join(sorted(rv, key=sort_key))\n", "sublist": "def evaluate(self, formatter, kwargs, mi, locals, val, start_index, end_index, sep):\n if not val:\n return ''\n si = int(start_index)\n ei = int(end_index)\n val = val.split(sep)\n try:\n if ei == 0:\n return sep.join(val[si:])\n else:\n return sep.join(val[si:ei])\n except:\n return ''\n", "test": "def evaluate(self, formatter, kwargs, mi, locals, val, value_if_set, value_not_set):\n if val:\n return value_if_set\n else:\n return value_not_set\n", "eval": "def evaluate(self, formatter, kwargs, mi, locals, template):\n from formatter import eval_formatter\n template = template.replace('[[', '{').replace(']]', '}')\n return eval_formatter.safe_format(template, locals, 'EVAL', None)\n",