Pull from trunk

This commit is contained in:
Kovid Goyal 2010-05-05 08:56:43 -06:00
commit ed6842b2f1
5 changed files with 141 additions and 2 deletions

View File

@ -0,0 +1,34 @@
from calibre.web.feeds.news import BasicNewsRecipe
class Arbetaren_SE(BasicNewsRecipe):
title = u'Arbetaren'
__author__ = 'Joakim Lindskog'
description = 'Nyheter fr\xc3\xa5n Arbetaren'
publisher = 'Arbetaren'
category = 'news, politics, socialism, Sweden'
oldest_article = 7
delay = 1
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'utf-8'
language = 'sv'
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
keep_only_tags = [dict(name='div', attrs={'id':'article'})]
remove_tags_before = dict(name='div', attrs={'id':'article'})
remove_tags_after = dict(name='p',attrs={'id':'byline'})
remove_tags = [
dict(name=['object','link','base']),
dict(name='p', attrs={'class':'print'}),
dict(name='a', attrs={'class':'addthis_button_compact'}),
dict(name='script')
]
feeds = [(u'Nyheter', u'http://www.arbetaren.se/rss/arbetaren.rss?rev=123')]

View File

@ -0,0 +1,39 @@
from calibre.web.feeds.news import BasicNewsRecipe
class Ekot_SE(BasicNewsRecipe):
title = 'Ekot'
__author__ = 'Joakim Lindskog'
description = 'Nyheter fr\xc3\xa5n Ekot'
publisher = 'Ekot'
category = 'news, politics, Sweden'
oldest_article = 7
delay = 1
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'utf-8'
language = 'sv'
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
keep_only_tags = [dict(name='h1', attrs={'class':'newsH2'}),
dict(name='div', attrs={'class':'articleTop'}),
dict(name='div', attrs={'class':'newsIntro'}),
dict(name='div', attrs={'class':'newsText'})]
remove_tags = [
dict(name=['object','link','base'])
,dict(name='span',attrs={'class':'relLink'})
]
feeds = [(u'Ekot', u'http://api.sr.se/api/rssfeed/rssfeed.aspx?rssfeed=83'),
(u'Utrikes', u'http://api.sr.se/api/rssfeed/rssfeed.aspx?rssfeed=3304'),
(u'Radiosporten', u'http://api.sr.se/api/rssfeed/rssfeed.aspx?rssfeed=179')]
def print_version(self, url):
return url.replace('http://sverigesradio.se/cgi-bin/ekot/artikel.asp',
'http://sverigesradio.se/cgi-bin/isidorpub/PrinterFriendlyArticle.asp')+'&ProgramID=83'

View File

@ -0,0 +1,66 @@
from calibre.web.feeds.news import BasicNewsRecipe
class FriaTidningen_SE(BasicNewsRecipe):
title = u'Fria Tidningen'
__author__ = 'Joakim Lindskog'
description = 'Nyheter fr\xc3\xa5n Fria Tidningen'
publisher = 'Fria Tidningen'
category = 'news, politics, Sweden'
oldest_article = 7
delay = 1
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
encoding = 'utf-8'
language = 'sv'
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
keep_only_tags = [dict(name='div', attrs={'id':'content-area'})]
remove_tags_before = dict(name='div', attrs={'id':'content-area'})
remove_tags_after = dict(name='div',attrs={'id':'byline'})
remove_tags = [
dict(name=['object','link','base']),
dict(name='div', attrs={'id':'comments'}),
dict(name='div', attrs={'id':'block-block-21'}),
dict(name='div', attrs={'id':'block-block-22'}),
dict(name='div', attrs={'id':'block-block-23'}),
dict(name='div', attrs={'id':'block-block-24'}),
dict(name='div', attrs={'id':'block-block-25'}),
dict(name='div', attrs={'id':'block-block-26'}),
dict(name='div', attrs={'id':'block-block-27'}),
dict(name='div', attrs={'id':'block-block-28'}),
dict(name='div', attrs={'id':'block-block-29'}),
dict(name='div', attrs={'id':'block-block-30'}),
dict(name='div', attrs={'id':'block-block-40'})
]
feeds = [(u'Allt', u'http://www.fria.nu/feed'),
(u'Nyheter', u'http://www.fria.nu/taxonomy/term/13/feed/feed'),
(u'Inrikes', u'http://www.fria.nu/taxonomy/term/14/0/feed'),
(u'Utrikes', u'http://www.fria.nu/taxonomy/term/15/0/feed'),
(u'Ekonomi', u'http://www.fria.nu/taxonomy/term/27047/0/feed'),
(u'Opinion', u'http://www.fria.nu/taxonomy/term/22/0/feed'),
(u'Inledaren', u'http://www.fria.nu/taxonomy/term/24/0/feed'),
(u'Argument', u'http://www.fria.nu/taxonomy/term/23/0/feed'),
(u'Synpunkten', u'http://www.fria.nu/taxonomy/term/26/0/feed'),
(u'Debatt', u'http://www.fria.nu/taxonomy/term/25/0/feed'),
(u'Kultur', u'http://www.fria.nu/taxonomy/term/19/0/feed'),
(u'Kulturnyheter', u'http://www.fria.nu/taxonomy/term/24534/0/feed'),
(u'Recensioner', u'http://www.fria.nu/taxonomy/term/24535/0/feed'),
(u'BAK', u'http://www.fria.nu/taxonomy/term/27/0/feed'),
(u'Sport & H\xc3\xa4lsa' u'http://www.fria.nu/taxonomy/term/27215/0/feed'),
(u'Sport', u'http://www.fria.nu/taxonomy/term/20/0/feed'),
(u'H\xc3\xa4lsa', u'http://www.fria.nu/taxonomy/term/21/0/feed'),
(u'F\xc3\xb6rdjupning', u'http://www.fria.nu/taxonomy/term/24994/0/feed'),
(u'Fokus', u'http://www.fria.nu/taxonomy/term/24864/0/feed'),
(u'Samtal', u'http://www.fria.nu/taxonomy/term/28/0/feed'),
(u'Stockholm', u'http://www.fria.nu/taxonomy/term/122/0/feed'),
(u'G\xc3\xb6teborg', u'http://www.fria.nu/taxonomy/term/73/0/feed'),
(u'Uppsala', u'http://www.fria.nu/taxonomy/term/27324/0/feed'),
(u'Malm\xc3\xb6', u'http://www.fria.nu/taxonomy/term/28031/0/feed')]

View File

@ -49,7 +49,7 @@ class Reader(FormatReader):
def decompress_text(self, number): def decompress_text(self, number):
if self.header_record.compression == 1: if self.header_record.compression == 1:
return self.section_data(number).decode('cp1252' if self.encoding is None else self.encoding) return self.section_data(number).decode('cp1252' if self.encoding is None else self.encoding)
if self.header_record.compression == 2: if self.header_record.compression == 2 or self.header_record.compression == 258:
from calibre.ebooks.compression.palmdoc import decompress_doc from calibre.ebooks.compression.palmdoc import decompress_doc
return decompress_doc(self.section_data(number)).decode('cp1252' if self.encoding is None else self.encoding, 'replace') return decompress_doc(self.section_data(number)).decode('cp1252' if self.encoding is None else self.encoding, 'replace')
return '' return ''

View File

@ -81,7 +81,7 @@ Device Integration
What devices does |app| support? What devices does |app| support?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At the moment |app| has full support for the SONY PRS 300/500/505/600/700/900, Barnes & Noble Nook, Cybook Gen 3/Opus, Amazon Kindle 1/2/DX, Entourage Edge, Longshine ShineBook, Ectaco Jetbook, BeBook/BeBook Mini, Irex Illiad/DR1000, Foxit eSlick, PocketBook 360, Italica, eClicto, Iriver Story, Airis dBook, Hanvon N515, Binatone Readme, Teclast K3, SpringDesign Alex, various Android phones and the iPhone. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk. At the moment |app| has full support for the SONY PRS 300/500/505/600/700/900, Barnes & Noble Nook, Cybook Gen 3/Opus, Amazon Kindle 1/2/DX, Entourage Edge, Longshine ShineBook, Ectaco Jetbook, BeBook/BeBook Mini, Irex Illiad/DR1000, Foxit eSlick, PocketBook 360, Italica, eClicto, Iriver Story, Airis dBook, Hanvon N515, Binatone Readme, Teclast K3, SpringDesign Alex, various Android phones and the iPhone/iPad. In addition, using the :guilabel:`Save to disk` function you can use it with any ebook reader that exports itself as a USB disk.
How can I help get my device supported in |app|? How can I help get my device supported in |app|?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~