Pull from trunk

This commit is contained in:
Kovid Goyal 2010-05-19 12:46:38 -06:00
commit 59664b6feb
6 changed files with 164 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 B

View File

@ -0,0 +1,45 @@
__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
emg.rs/en/news
'''
from calibre.web.feeds.news import BasicNewsRecipe
class emportal_en(BasicNewsRecipe):
title = 'Ekonom:east News'
__author__ = 'Darko Miletic'
description = 'Daily business news from Serbia.'
publisher = 'Ekonom:east Media Group'
category = 'Business, SEE, Serbia, Belgrade, news, Ekonomist, EMportal'
oldest_article = 2
max_articles_per_feed = 200
no_stylesheets = True
encoding = 'utf8'
use_embedded_content = False
language = 'en'
remove_empty_feeds = True
masthead_url = 'http://www.emg.rs/img/emportal-rss.png'
extra_css = ' body{font-family: Arial,Helvetica,sans-serif } '
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
remove_tags = [dict(attrs={'class':['text-share']})]
keep_only_tags = [dict(attrs={'class':'text'})]
remove_tags_after = dict(attrs={'class':'text-share'})
remove_attributes = ['width','height']
feeds = [(u'Serbia' , u'http://www.emg.rs/en/news/serbia/rss.xml')]
def print_version(self, url):
return url.replace('.html','.print.html')
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup

View File

@ -0,0 +1,51 @@
__license__ = 'GPL v3'
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
'''
emg.rs/vesti
'''
import re
from calibre.web.feeds.news import BasicNewsRecipe
class emportal_rs(BasicNewsRecipe):
title = 'Ekonom:east Vesti'
__author__ = 'Darko Miletic'
description = 'Vasa dnevna doza poslovnih informacija iz Srbije, regiona i sveta. Vesti, Berze, Dogadaji, Casopisi.'
publisher = 'Ekonom:east Media Group'
category = 'Ekonom:east Media Group, Ekonomist, Budelar, Bankar, EMportal, Preduzeca, Moja Posla, EU praktikum, ekonomija, Srbija, Beograd, investicije, finansije, energetika, berza'
oldest_article = 2
max_articles_per_feed = 200
no_stylesheets = True
encoding = 'utf8'
use_embedded_content = False
language = 'sr'
remove_empty_feeds = True
masthead_url = 'http://www.emg.rs/img/emportal-rss.png'
extra_css = ' @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Arial,Helvetica,sans1,sans-serif } .article_description{font-family: sans1, sans-serif} '
conversion_options = {
'comment' : description
, 'tags' : category
, 'publisher' : publisher
, 'language' : language
}
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
remove_tags = [dict(attrs={'class':['text-share']})]
keep_only_tags = [dict(attrs={'class':'text'})]
remove_tags_after = dict(attrs={'class':'text-share'})
remove_attributes = ['width','height']
feeds = [
(u'Srbija' , u'http://www.emg.rs/vesti/srbija/rss.xml')
,(u'Region' , u'http://www.emg.rs/vesti/region/rss.xml')
,(u'Svet' , u'http://www.emg.rs/vesti/svet/rss.xml' )
]
def print_version(self, url):
return url.replace('.html','.print.html')
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
return soup

View File

@ -0,0 +1,67 @@
#!/usr/bin/env python
__license__ = 'GPL v3'
__author__ = 'Gabriele Marini, based on Darko Miletic'
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
__description__ = 'La Stampa 05/05/2010'
'''
http://www.lastampa.it/
'''
from calibre.web.feeds.news import BasicNewsRecipe
class LaStampa(BasicNewsRecipe):
title = u'La Stampa'
language = 'it'
__author__ = 'Gabriele Marini'
oldest_article = 15
max_articles_per_feed = 50
recursion = 100
cover_url = 'http://www.lastampa.it/edicola/PDF/1.pdf'
use_embedded_content = False
remove_javascript = True
no_stylesheets = True
conversion_options = {'linearize_tables':True}
remove_attributes = ['colspan']
extra_css = ' .boxocchiello2{font-size: small} .catenaccio{font-style: italic} .titoloRub{font-size: xx-large; font-weight: bold } .titologir{font-size: xx-large; font-weight: bold } .sezione{font-weight: bold} '
def get_article_url(self, article):
link = article.get('links')
if link:
return link[0]['href']
keep_only_tags = [dict(attrs={'class':['boxocchiello2','titoloRub','titologir','catenaccio','sezione','articologirata']}),
dict(name='div', attrs={'id':'corpoarticolo'})
]
remove_tags = [dict(name='div', attrs={'id':'menutop'}),
dict(name='div', attrs={'id':'fwnetblocco'}),
dict(name='table', attrs={'id':'strumenti'}),
dict(name='table', attrs={'id':'imgesterna'}),
dict(name='a', attrs={'class':'linkblu'}),
dict(name='a', attrs={'class':'link'}),
dict(name='span', attrs={'class':['boxocchiello','boxocchiello2','sezione']})
]
feeds = [
(u'Home', u'http://www.lastampa.it/redazione/rss_home.xml'),
(u'Editoriali', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=25'),
(u'Politica', u'http://www.lastampa.it/redazione/cmssezioni/politica/rss_politica.xml'),
(u'ArciItaliana', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=14'),
(u'Cronache', u'http://www.lastampa.it/redazione/cmssezioni/cronache/rss_cronache.xml'),
(u'Esteri', u'http://www.lastampa.it/redazione/cmssezioni/esteri/rss_esteri.xml'),
(u'Danni Collaterali', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=90'),
(u'Economia', u'http://www.lastampa.it/redazione/cmssezioni/economia/rss_economia.xml'),
(u'Tecnologia ', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=30'),
(u'Spettacoli', u'http://www.lastampa.it/redazione/cmssezioni/spettacoli/rss_spettacoli.xml'),
(u'Sport', u'http://www.lastampa.it/sport/rss_home.xml'),
(u'Torino', u'http://rss.feedsportal.com/c/32418/f/466938/index.rss'),
(u'Motori', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=57'),
(u'Scienza', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=38'),
(u'Fotografia', u'http://rss.feedsportal.com/c/32418/f/478449/index.rss'),
(u'Scuola', u'http://www.lastampa.it/cmstp/rubriche/oggetti/rss.asp?ID_blog=60'),
(u'Tempo Libero', u'http://www.lastampa.it/tempolibero/rss_home.xml')
]

View File

@ -20,7 +20,7 @@ class PALMPRE(USBMS):
FORMATS = ['mobi', 'prc', 'pdb', 'txt'] FORMATS = ['mobi', 'prc', 'pdb', 'txt']
VENDOR_ID = [0x0830] VENDOR_ID = [0x0830]
PRODUCT_ID = [0x8004, 0x8002] PRODUCT_ID = [0x8004, 0x8002, 0x0101]
BCD = [0x0316] BCD = [0x0316]
VENDOR_NAME = 'PALM' VENDOR_NAME = 'PALM'