diff --git a/resources/recipes/ajc.recipe b/resources/recipes/ajc.recipe index 82809f626c..ccd0efebdd 100644 --- a/resources/recipes/ajc.recipe +++ b/resources/recipes/ajc.recipe @@ -1,8 +1,18 @@ -from calibre.web.feeds.news import BasicNewsRecipe +#!/usr/bin/env python +__license__ = 'GPL v3' +__author__ = 'Tony Stegall' +__copyright__ = '2010, Tony Stegall or Tonythebookworm on mobiread.com' +__version__ = '1.03' +__date__ = '27, September 2010' +__docformat__ = 'restructuredtext en' + + +import datetime class AdvancedUserRecipe1282101454(BasicNewsRecipe): + now = datetime.datetime.now() title = 'The AJC' - language = 'en' + timefmt = ' [%a,%d %B %Y %I:%M %p]' __author__ = 'TonytheBookworm' description = 'News from Atlanta and USA' publisher = 'The Atlanta Journal' @@ -10,35 +20,39 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): oldest_article = 1 max_articles_per_feed = 100 no_stylesheets = True - + masthead_url = 'http://gawand.org/wp-content/uploads/2010/06/ajc-logo.gif' 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;} - p{font-family:Arial,Helvetica,sans-serif;font-size:small;} - body{font-family:Helvetica,Arial,sans-serif;font-size:small;} + h1.articleHeadline{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;} + h2.articleSubheadline{font-family:Arial,Helvetica,sans-serif; font-weight:normal;font-size:small;} + + p.byline{text-align:right; font-size:small;margin-top:0px;margin-bottom: 0px;} + p.organization{text-align:right; font-size:small;margin-top:0px;margin-bottom: 0px;} + + + p{font-family:Helvetica,Arial,sans-serif;font-size:small;} ''' - - + + keep_only_tags = [ dict(name='div', attrs={'class':['cxArticleHeader']}) ,dict(attrs={'id':['cxArticleText']}) ] - - + + remove_tags = [ dict(name='div' , attrs={'class':'cxArticleList' }) ,dict(name='div' , attrs={'class':'cxFeedTease' }) ,dict(name='div' , attrs={'class':'cxElementEnlarge' }) ,dict(name='div' , attrs={'id':'cxArticleTools' }) ] - - - + + + feeds = [ ('Breaking News', 'http://www.ajc.com/genericList-rss.do?source=61499'), # ------------------------------------------------------------------- - # Here are the different area feeds. Choose which ever one you wish to + # Here are the different area feeds. Choose which ever one you wish to # read by simply removing the pound sign from it. I currently have it # set to only get the Cobb area # -------------------------------------------------------------------- @@ -56,7 +70,7 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): ('Opinions', 'http://www.ajc.com/section-rss.do?source=opinion'), ('Ga Politics', 'http://www.ajc.com/section-rss.do?source=georgia-politics-elections'), # ------------------------------------------------------------------------ - # Here are the different sports feeds. I only follow the Falcons, and Highschool + # Here are the different sports feeds. I only follow the Falcons, and Highschool # but again # You can enable which ever team you like by removing the pound sign # ------------------------------------------------------------------------ @@ -71,23 +85,25 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): ('Music', 'http://www.accessatlanta.com/section-rss.do?source=music'), ] + + def postprocess_html(self, soup, first): for credit_tag in soup.findAll('span', attrs={'class':['imageCredit rightFloat']}): - credit_tag.name ='p' - + credit_tag.extract() + return soup - + #def print_version(self, url): # return url.partition('?')[0] +'?printArticle=y' + + + + - - - - - - + + diff --git a/resources/recipes/boortz.recipe b/resources/recipes/boortz.recipe index 0b52e0b9ca..dfb624c4bc 100644 --- a/resources/recipes/boortz.recipe +++ b/resources/recipes/boortz.recipe @@ -1,3 +1,12 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__author__ = 'Tony Stegall' +__copyright__ = '2010, Tony Stegall or Tonythebookworm on mobiread.com' +__version__ = '1.04' +__date__ = '27, September 2010' +__docformat__ = 'restructuredtext en' + + from calibre.web.feeds.news import BasicNewsRecipe from calibre.ebooks.BeautifulSoup import BeautifulSoup, re class AdvancedUserRecipe1282101454(BasicNewsRecipe): @@ -7,38 +16,15 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe): description = 'Neal Boortz Show Radio Notes' publisher = 'Neal Boortz' category = 'news, politics, USA, talkshow' - oldest_article = 2 + oldest_article = 1 max_articles_per_feed = 100 - linearize_tables = True + no_stylesheets = True remove_javascript = True - + use_embedded_content = True masthead_url = 'http://boortz.com/images/nuze_logo.gif' - keep_only_tags = [ - dict(name='td', attrs={'id':['contentWellCell']}) - - ] - remove_tags = [ - dict(name='a', attrs={'class':['blogPermalink']}), - dict(name='span', attrs={'class':['blogBylineSeparator']}), - dict(name='td', attrs={'id':['nealztitle']}), - ] - remove_tags_after = [dict(name='div', attrs={'class':'blogEntryBody'}),] + conversion_options = {'linearize_tables' : True} feeds = [ ('NUZE', 'http://boortz.com/nealz_nuze_rss/rss.xml') ] - - - - - - - - - - - - - - diff --git a/resources/recipes/twtfb.recipe b/resources/recipes/twtfb.recipe new file mode 100644 index 0000000000..bb2bfe2348 --- /dev/null +++ b/resources/recipes/twtfb.recipe @@ -0,0 +1,40 @@ +__license__ = 'GPL v3' +__copyright__ = '2010, Darko Miletic ' +''' +www.thewaythefutureblogs.com +Frederik Pohl's Blog +''' + +from calibre.web.feeds.news import BasicNewsRecipe + +class TheWayTheFutureBlogs(BasicNewsRecipe): + title = 'The Way the Future Blogs' + __author__ = 'Darko Miletic' + description = "Frederik Pohl's blog" + publisher = 'Frederik Pohl' + category = 'news, SF, books' + oldest_article = 30 + max_articles_per_feed = 200 + no_stylesheets = True + encoding = 'utf8' + use_embedded_content = False + language = 'en' + remove_empty_feeds = True + extra_css = ' body{font-family: Georgia,serif } ' + + conversion_options = { + 'comment' : description + , 'tags' : category + , 'publisher' : publisher + , 'language' : language + } + remove_tags =[dict(name=['meta','object','embed','iframe','base','link'])] + keep_only_tags=[dict(attrs={'class':['post','commentlist']})] + remove_attributes=['width','height','lang','border'] + + feeds = [(u'Posts', u'http://www.thewaythefutureblogs.com/feed/')] + + def preprocess_html(self, soup): + for item in soup.findAll(style=True): + del item['style'] + return soup diff --git a/src/calibre/gui2/tools.py b/src/calibre/gui2/tools.py index 2f0452a773..c068168247 100644 --- a/src/calibre/gui2/tools.py +++ b/src/calibre/gui2/tools.py @@ -217,9 +217,12 @@ def fetch_scheduled_recipe(arg): if 'output_profile' in ps: recs.append(('output_profile', ps['output_profile'], OptionRecommendation.HIGH)) - if ps['output_profile'] == 'kindle': - recs.append(('no_inline_toc', True, - OptionRecommendation.HIGH)) + # Disabled since apparently some people use + # K4PC and, surprise, surprise, it doesn't support + # indexed MOBIs. + #if ps['output_profile'] == 'kindle': + # recs.append(('no_inline_toc', True, + # OptionRecommendation.HIGH)) lf = load_defaults('look_and_feel') if lf.get('base_font_size', 0.0) != 0.0: diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index beea30acb2..ab674a17f1 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -282,7 +282,7 @@ Watch the tutorial `UI Power tips `_ to How do I move my |app| library from one computer to another? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Simply copy the |app| library folder from the old to the new computer. You can find out what the library folder is by clicking the calibre icon in the toolbar. The very first item is the path to the library folder. Now on the new computer, start |app| for the first time. It will run the Welcome Wizard asking you for the location of the |app| library. Point it to the previously copied folder. +Simply copy the |app| library folder from the old to the new computer. You can find out what the library folder is by clicking the calibre icon in the toolbar. The very first item is the path to the library folder. Now on the new computer, start |app| for the first time. It will run the Welcome Wizard asking you for the location of the |app| library. Point it to the previously copied folder. If the computer you are transferring too already has a calibre installation, then the Welcome wizard wont run. In that case, click the calibre icon in the tooolbar and point it to the newly copied directory. You will now have two calibre libraries on your computer and you can switch between them by clicking the calibre icon on the toolbar. Note that if you are transferring between different types of computers (for example Windows to OS X) then after doing the above you should also go to :guilabel:`Preferences->Advanced->Miscellaneous` and click the "Check database integrity button". It will warn you about missing files, if any, which you should then transfer by hand.