Merge from trunk
BIN
resources/images/news/avantaje.png
Normal file
After Width: | Height: | Size: 924 B |
BIN
resources/images/news/onemagazine.png
Normal file
After Width: | Height: | Size: 316 B |
BIN
resources/images/news/pcworldro.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
resources/images/news/protvmagazin.png
Normal file
After Width: | Height: | Size: 251 B |
BIN
resources/images/news/psychologies.png
Normal file
After Width: | Height: | Size: 750 B |
BIN
resources/images/news/tvmania.png
Normal file
After Width: | Height: | Size: 379 B |
BIN
resources/images/news/viva.png
Normal file
After Width: | Height: | Size: 747 B |
57
resources/recipes/avantaje.recipe
Normal file
@ -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)
|
46
resources/recipes/bay_citizen.recipe
Normal file
@ -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
|
72
resources/recipes/onemagazine.recipe
Normal file
@ -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)
|
67
resources/recipes/pcworldro.recipe
Normal file
@ -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)
|
71
resources/recipes/protvmagazin.recipe
Normal file
@ -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)
|
59
resources/recipes/psychologies.recipe
Normal file
@ -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)
|
56
resources/recipes/sltrib.py
Normal file
@ -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
|
||||||
|
|
@ -3,6 +3,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
|||||||
class AdvancedUserRecipe1299054026(BasicNewsRecipe):
|
class AdvancedUserRecipe1299054026(BasicNewsRecipe):
|
||||||
title = u'Thai Post Daily'
|
title = u'Thai Post Daily'
|
||||||
__author__ = 'Chotechai P.'
|
__author__ = 'Chotechai P.'
|
||||||
|
language = 'th'
|
||||||
oldest_article = 7
|
oldest_article = 7
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
cover_url = 'http://upload.wikimedia.org/wikipedia/th/1/10/ThaiPost_Logo.png'
|
cover_url = 'http://upload.wikimedia.org/wikipedia/th/1/10/ThaiPost_Logo.png'
|
||||||
|
72
resources/recipes/tvmania.recipe
Normal file
@ -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)
|
75
resources/recipes/viva.recipe
Normal file
@ -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)
|
@ -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",
|
"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",
|
"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",
|
"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",
|
"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",
|
"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",
|
"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",
|
||||||
|
@ -469,19 +469,19 @@ class MetadataSingleDialog(ResizableDialog, Ui_MetadataSingleDialog):
|
|||||||
self.ts_tooltips = (ok_tooltip, bad_tooltip)
|
self.ts_tooltips = (ok_tooltip, bad_tooltip)
|
||||||
self.row_delta = 0
|
self.row_delta = 0
|
||||||
if prev:
|
if prev:
|
||||||
self.prev_button = QPushButton(QIcon(I('back.png')), _('&Previous'),
|
self.prev_button = QPushButton(QIcon(I('back.png')), _('Previous'),
|
||||||
self)
|
self)
|
||||||
self.button_box.addButton(self.prev_button, self.button_box.ActionRole)
|
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.setToolTip(tip)
|
||||||
self.prev_button.clicked.connect(partial(self.next_triggered,
|
self.prev_button.clicked.connect(partial(self.next_triggered,
|
||||||
-1))
|
-1))
|
||||||
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
|
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
|
||||||
if next_:
|
if next_:
|
||||||
self.next_button = QPushButton(QIcon(I('forward.png')), _('&Next'),
|
self.next_button = QPushButton(QIcon(I('forward.png')), _('Next'),
|
||||||
self)
|
self)
|
||||||
self.button_box.addButton(self.next_button, self.button_box.ActionRole)
|
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.setToolTip(tip)
|
||||||
self.next_button.clicked.connect(partial(self.next_triggered, 1))
|
self.next_button.clicked.connect(partial(self.next_triggered, 1))
|
||||||
self.next_button.setShortcut(QKeySequence('Alt+Right'))
|
self.next_button.setShortcut(QKeySequence('Alt+Right'))
|
||||||
|
@ -43,11 +43,11 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
self)
|
self)
|
||||||
self.button_box.accepted.connect(self.accept)
|
self.button_box.accepted.connect(self.accept)
|
||||||
self.button_box.rejected.connect(self.reject)
|
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)
|
||||||
self.next_button.setShortcut(QKeySequence('Alt+Right'))
|
self.next_button.setShortcut(QKeySequence('Alt+Right'))
|
||||||
self.next_button.clicked.connect(partial(self.do_one, delta=1))
|
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)
|
||||||
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
|
self.prev_button.setShortcut(QKeySequence('Alt+Left'))
|
||||||
|
|
||||||
|
@ -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.
|
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.
|
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.
|
See the :ref:`config_filename_metadata` section, to learn how to configure this.
|
||||||
|
|
||||||
|