mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
merge from trunK
This commit is contained in:
commit
94d01f9885
@ -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):
|
class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
||||||
|
now = datetime.datetime.now()
|
||||||
title = 'The AJC'
|
title = 'The AJC'
|
||||||
language = 'en'
|
timefmt = ' [%a,%d %B %Y %I:%M %p]'
|
||||||
__author__ = 'TonytheBookworm'
|
__author__ = 'TonytheBookworm'
|
||||||
description = 'News from Atlanta and USA'
|
description = 'News from Atlanta and USA'
|
||||||
publisher = 'The Atlanta Journal'
|
publisher = 'The Atlanta Journal'
|
||||||
@ -10,35 +20,39 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
|||||||
oldest_article = 1
|
oldest_article = 1
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
|
||||||
masthead_url = 'http://gawand.org/wp-content/uploads/2010/06/ajc-logo.gif'
|
masthead_url = 'http://gawand.org/wp-content/uploads/2010/06/ajc-logo.gif'
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
h1{font-family:Arial,Helvetica,sans-serif; font-weight:bold;font-size:large;}
|
h1.articleHeadline{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;}
|
h2.articleSubheadline{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;}
|
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 = [
|
keep_only_tags = [
|
||||||
dict(name='div', attrs={'class':['cxArticleHeader']})
|
dict(name='div', attrs={'class':['cxArticleHeader']})
|
||||||
,dict(attrs={'id':['cxArticleText']})
|
,dict(attrs={'id':['cxArticleText']})
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
remove_tags = [
|
remove_tags = [
|
||||||
dict(name='div' , attrs={'class':'cxArticleList' })
|
dict(name='div' , attrs={'class':'cxArticleList' })
|
||||||
,dict(name='div' , attrs={'class':'cxFeedTease' })
|
,dict(name='div' , attrs={'class':'cxFeedTease' })
|
||||||
,dict(name='div' , attrs={'class':'cxElementEnlarge' })
|
,dict(name='div' , attrs={'class':'cxElementEnlarge' })
|
||||||
,dict(name='div' , attrs={'id':'cxArticleTools' })
|
,dict(name='div' , attrs={'id':'cxArticleTools' })
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
feeds = [
|
feeds = [
|
||||||
('Breaking News', 'http://www.ajc.com/genericList-rss.do?source=61499'),
|
('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
|
# read by simply removing the pound sign from it. I currently have it
|
||||||
# set to only get the Cobb area
|
# set to only get the Cobb area
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
@ -56,7 +70,7 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
|||||||
('Opinions', 'http://www.ajc.com/section-rss.do?source=opinion'),
|
('Opinions', 'http://www.ajc.com/section-rss.do?source=opinion'),
|
||||||
('Ga Politics', 'http://www.ajc.com/section-rss.do?source=georgia-politics-elections'),
|
('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
|
# but again
|
||||||
# You can enable which ever team you like by removing the pound sign
|
# 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'),
|
('Music', 'http://www.accessatlanta.com/section-rss.do?source=music'),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def postprocess_html(self, soup, first):
|
def postprocess_html(self, soup, first):
|
||||||
for credit_tag in soup.findAll('span', attrs={'class':['imageCredit rightFloat']}):
|
for credit_tag in soup.findAll('span', attrs={'class':['imageCredit rightFloat']}):
|
||||||
credit_tag.name ='p'
|
credit_tag.extract()
|
||||||
|
|
||||||
return soup
|
return soup
|
||||||
|
|
||||||
#def print_version(self, url):
|
#def print_version(self, url):
|
||||||
# return url.partition('?')[0] +'?printArticle=y'
|
# return url.partition('?')[0] +'?printArticle=y'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, re
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup, re
|
||||||
class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
||||||
@ -7,38 +16,15 @@ class AdvancedUserRecipe1282101454(BasicNewsRecipe):
|
|||||||
description = 'Neal Boortz Show Radio Notes'
|
description = 'Neal Boortz Show Radio Notes'
|
||||||
publisher = 'Neal Boortz'
|
publisher = 'Neal Boortz'
|
||||||
category = 'news, politics, USA, talkshow'
|
category = 'news, politics, USA, talkshow'
|
||||||
oldest_article = 2
|
oldest_article = 1
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
linearize_tables = True
|
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
|
use_embedded_content = True
|
||||||
masthead_url = 'http://boortz.com/images/nuze_logo.gif'
|
masthead_url = 'http://boortz.com/images/nuze_logo.gif'
|
||||||
keep_only_tags = [
|
conversion_options = {'linearize_tables' : True}
|
||||||
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'}),]
|
|
||||||
feeds = [
|
feeds = [
|
||||||
('NUZE', 'http://boortz.com/nealz_nuze_rss/rss.xml')
|
('NUZE', 'http://boortz.com/nealz_nuze_rss/rss.xml')
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
40
resources/recipes/twtfb.recipe
Normal file
40
resources/recipes/twtfb.recipe
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
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
|
@ -217,9 +217,12 @@ def fetch_scheduled_recipe(arg):
|
|||||||
if 'output_profile' in ps:
|
if 'output_profile' in ps:
|
||||||
recs.append(('output_profile', ps['output_profile'],
|
recs.append(('output_profile', ps['output_profile'],
|
||||||
OptionRecommendation.HIGH))
|
OptionRecommendation.HIGH))
|
||||||
if ps['output_profile'] == 'kindle':
|
# Disabled since apparently some people use
|
||||||
recs.append(('no_inline_toc', True,
|
# K4PC and, surprise, surprise, it doesn't support
|
||||||
OptionRecommendation.HIGH))
|
# indexed MOBIs.
|
||||||
|
#if ps['output_profile'] == 'kindle':
|
||||||
|
# recs.append(('no_inline_toc', True,
|
||||||
|
# OptionRecommendation.HIGH))
|
||||||
|
|
||||||
lf = load_defaults('look_and_feel')
|
lf = load_defaults('look_and_feel')
|
||||||
if lf.get('base_font_size', 0.0) != 0.0:
|
if lf.get('base_font_size', 0.0) != 0.0:
|
||||||
|
@ -282,7 +282,7 @@ Watch the tutorial `UI Power tips <http://calibre-ebook.com/demo#tutorials>`_ to
|
|||||||
|
|
||||||
How do I move my |app| library from one computer to another?
|
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.
|
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.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user