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/bay_citizen.recipe b/resources/recipes/bay_citizen.recipe new file mode 100644 index 0000000000..e6a6c2b63d --- /dev/null +++ b/resources/recipes/bay_citizen.recipe @@ -0,0 +1,46 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class TheBayCitizen(BasicNewsRecipe): + title = 'The Bay Citizen' + language = 'en' + __author__ = 'noah' + description = 'The Bay Citizen' + publisher = 'The Bay Citizen' + INDEX = u'http://www.baycitizen.org' + category = 'news' + oldest_article = 2 + max_articles_per_feed = 20 + no_stylesheets = True + masthead_url = 'http://media.baycitizen.org/images/layout/logo1.png' + feeds = [('Main Feed', 'http://www.baycitizen.org/feeds/stories/')] + keep_only_tags = [dict(name='div', attrs={'class':'story'})] + remove_tags = [ + dict(name='div', attrs={'class':'socialBar'}), + dict(name='div', attrs={'id':'text-resize'}), + dict(name='div', attrs={'class':'story relatedContent'}), + dict(name='div', attrs={'id':'comment_status_loading'}), + ] + + def append_page(self, soup, appendtag, position): + pager = soup.find('a',attrs={'class':'stry-next'}) + if pager: + nexturl = self.INDEX + pager['href'] + soup2 = self.index_to_soup(nexturl) + texttag = soup2.find('div', attrs={'class':'body'}) + for it in texttag.findAll(style=True): + del it['style'] + newpos = len(texttag.contents) + self.append_page(soup2,texttag,newpos) + texttag.extract() + appendtag.insert(position,texttag) + + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + self.append_page(soup, soup.body, 3) + garbage = soup.findAll(id='story-pagination') + [trash.extract() for trash in garbage] + garbage = soup.findAll('em', 'cont-from-prev') + [trash.extract() for trash in garbage] + return 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/sltrib.py b/resources/recipes/sltrib.py new file mode 100644 index 0000000000..a6701ae296 --- /dev/null +++ b/resources/recipes/sltrib.py @@ -0,0 +1,56 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class AdvancedUserRecipe1278347258(BasicNewsRecipe): + title = u'Salt Lake City Tribune' + __author__ = 'Charles Holbert' + oldest_article = 7 + max_articles_per_feed = 100 + + description = '''Utah's independent news source since 1871''' + publisher = 'http://www.sltrib.com/' + category = 'news, Utah, SLC' + language = 'en' + encoding = 'utf-8' + #delay = 1 + #simultaneous_downloads = 1 + remove_javascript = True + use_embedded_content = False + no_stylesheets = True + + #masthead_url = 'http://www.sltrib.com/csp/cms/sites/sltrib/assets/images/logo_main.png' + #cover_url = 'http://webmedia.newseum.org/newseum-multimedia/dfp/jpg9/lg/UT_SLT.jpg' + + keep_only_tags = [dict(name='div',attrs={'id':'imageBox'}) + ,dict(name='div',attrs={'class':'headline'}) + ,dict(name='div',attrs={'class':'byline'}) + ,dict(name='p',attrs={'class':'TEXT_w_Indent'})] + + feeds = [(u'SL Tribune Today', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rss.csp?cat=All'), + (u'Utah News', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rss.csp?cat=UtahNews'), + (u'Business News', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rss.csp?cat=Money'), + (u'Technology', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rss.csp?cat=Technology'), + (u'Most Popular', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rsspopular.csp'), + (u'Sports', u'http://www.sltrib.com/csp/cms/sites/sltrib/RSS/rss.csp?cat=Sports')] + + extra_css = ''' + .headline{font-family:Arial,Helvetica,sans-serif; font-size:xx-large; font-weight: bold; color:#0E5398;} + .byline{font-family:Arial,Helvetica,sans-serif; color:#333333; font-size:xx-small;} + .storytext{font-family:Arial,Helvetica,sans-serif; font-size:medium;} + ''' + + def print_version(self, url): + seg = url.split('/') + x = seg[5].split('-') + baseURL = 'http://www.sltrib.com/csp/cms/sites/sltrib/pages/printerfriendly.csp?id=' + s = baseURL + x[0] + return s + + def get_cover_url(self): + cover_url = None + href = 'http://www.newseum.org/todaysfrontpages/hr.asp?fpVname=UT_SLT&ref_pge=lst' + soup = self.index_to_soup(href) + div = soup.find('div',attrs={'class':'tfpLrgView_container'}) + if div: + cover_url = div.img['src'] + return cover_url + 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", diff --git a/src/calibre/gui2/dialogs/metadata_single.py b/src/calibre/gui2/dialogs/metadata_single.py index 3715d27bfc..9efe7f7160 100644 --- a/src/calibre/gui2/dialogs/metadata_single.py +++ b/src/calibre/gui2/dialogs/metadata_single.py @@ -469,19 +469,19 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog): self.ts_tooltips = (ok_tooltip, bad_tooltip) self.row_delta = 0 if prev: - self.prev_button = QPushButton(QIcon(I('back.png')), _('&Previous'), + self.prev_button = QPushButton(QIcon(I('back.png')), _('Previous'), self) self.button_box.addButton(self.prev_button, self.button_box.ActionRole) - tip = _('Save changes and edit the metadata of %s')%prev + tip = (_('Save changes and edit the metadata of %s')+' [Alt+Left]')%prev self.prev_button.setToolTip(tip) self.prev_button.clicked.connect(partial(self.next_triggered, -1)) self.prev_button.setShortcut(QKeySequence('Alt+Left')) if next_: - self.next_button = QPushButton(QIcon(I('forward.png')), _('&Next'), + self.next_button = QPushButton(QIcon(I('forward.png')), _('Next'), self) self.button_box.addButton(self.next_button, self.button_box.ActionRole) - tip = _('Save changes and edit the metadata of %s')%next_ + tip = (_('Save changes and edit the metadata of %s')+' [Alt+Right]')%next_ self.next_button.setToolTip(tip) self.next_button.clicked.connect(partial(self.next_triggered, 1)) self.next_button.setShortcut(QKeySequence('Alt+Right')) diff --git a/src/calibre/gui2/metadata/single.py b/src/calibre/gui2/metadata/single.py index d2b932c7ec..3b6dd0e253 100644 --- a/src/calibre/gui2/metadata/single.py +++ b/src/calibre/gui2/metadata/single.py @@ -43,11 +43,11 @@ class MetadataSingleDialogBase(ResizableDialog): self) self.button_box.accepted.connect(self.accept) self.button_box.rejected.connect(self.reject) - self.next_button = QPushButton(QIcon(I('forward.png')), _('&Next'), + self.next_button = QPushButton(QIcon(I('forward.png')), _('Next'), self) self.next_button.setShortcut(QKeySequence('Alt+Right')) self.next_button.clicked.connect(partial(self.do_one, delta=1)) - self.prev_button = QPushButton(QIcon(I('back.png')), _('&Previous'), + self.prev_button = QPushButton(QIcon(I('back.png')), _('Previous'), self) self.prev_button.setShortcut(QKeySequence('Alt+Left')) diff --git a/src/calibre/manual/gui.rst b/src/calibre/manual/gui.rst index 208906cbf9..158bd81e50 100644 --- a/src/calibre/manual/gui.rst +++ b/src/calibre/manual/gui.rst @@ -55,6 +55,8 @@ Add books 5. **Add by ISBN**: Allows you to add one or more books by entering just their ISBN into a list or pasting the list of ISBNs from your clipboard. + 6. **Add files to selected book records**: Allows you to add or update the files associated with an existing book in your library. + The :guilabel:`Add books` action can read metadata from a wide variety of e-book formats. In addition it tries to guess metadata from the filename. See the :ref:`config_filename_metadata` section, to learn how to configure this.