mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1794 (recipes language) and add new recipes for The Honolulu Advertiser and The Star Bulletin by Darko Miletic
This commit is contained in:
parent
3c402a26b0
commit
1013b69ab4
BIN
src/calibre/gui2/images/news/starbulletin.png
Normal file
BIN
src/calibre/gui2/images/news/starbulletin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 983 B |
@ -26,7 +26,8 @@ recipe_modules = ['recipe_' + r for r in (
|
||||
'laprensa', 'amspec', 'freakonomics', 'criticadigital', 'elcronista',
|
||||
'shacknews', 'teleread', 'granma', 'juventudrebelde', 'juventudrebelde_english',
|
||||
'la_tercera', 'el_mercurio_chile', 'la_cuarta', 'lanacion_chile', 'la_segunda',
|
||||
'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz', 'exiled',
|
||||
'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz',
|
||||
'honoluluadvertiser', 'starbulletin', 'exiled',
|
||||
)]
|
||||
|
||||
import re, imp, inspect, time, os
|
||||
|
@ -13,6 +13,7 @@ class Blic(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Blic.rs online verzija najtiraznije novine u Srbiji donosi najnovije vesti iz Srbije i sveta, komentare, politicke analize, poslovne i ekonomske vesti, vesti iz regiona, intervjue, informacije iz kulture, reportaze, pokriva sve sportske dogadjaje, detaljan tv program, nagradne igre, zabavu, fenomenalni Blic strip, dnevni horoskop, arhivu svih dogadjaja'
|
||||
oldest_article = 7
|
||||
language = _('Serbian')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -13,6 +13,7 @@ class Danas(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Dnevne novine sa vestima iz sveta, politike, ekonomije, kulture, sporta, Beograda, Novog Sada i cele Srbije.'
|
||||
oldest_article = 2
|
||||
language = _('Serbian')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -9,7 +9,7 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
class DeStandaard(BasicNewsRecipe):
|
||||
title = u'De Standaard'
|
||||
__author__ = u'Darko Miletic'
|
||||
language = _('French')
|
||||
language = _('Dutch')
|
||||
description = u'News from Belgium'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
|
@ -13,6 +13,7 @@ class DeMorganBe(BasicNewsRecipe):
|
||||
__author__ = u'Darko Miletic'
|
||||
description = u'News from Belgium'
|
||||
oldest_article = 7
|
||||
language = _('Dutch')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -13,7 +13,7 @@ class Estadao(BasicNewsRecipe):
|
||||
title = 'O Estado de S. Paulo'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
language = _('Spanish')
|
||||
language = _('Portugese')
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
|
58
src/calibre/web/feeds/recipes/recipe_honoluluadvertiser.py
Normal file
58
src/calibre/web/feeds/recipes/recipe_honoluluadvertiser.py
Normal file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
honoluluadvertiser.com
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Honoluluadvertiser(BasicNewsRecipe):
|
||||
title = 'Honolulu Advertiser'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = "Latest national and local Hawaii sports news from The Honolulu Advertiser."
|
||||
publisher = 'Honolulu Advertiser'
|
||||
category = 'news, Honolulu, Hawaii'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
remove_javascript = True
|
||||
cover_url = 'http://www.honoluluadvertiser.com/graphics/branding.gif'
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment' , description
|
||||
, '--category' , category
|
||||
, '--publisher' , publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [dict(name='td')]
|
||||
|
||||
remove_tags = [dict(name=['object','link'])]
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'Breaking news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS01&MIME=XML' )
|
||||
,(u'Local news', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS02&MIME=XML' )
|
||||
,(u'Sports', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS03&MIME=XML' )
|
||||
,(u'Island life', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS05&MIME=XML' )
|
||||
,(u'Entertainment', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS06&MIME=XML' )
|
||||
,(u'Business', u'http://www.honoluluadvertiser.com/apps/pbcs.dll/section?Category=RSS04&MIME=XML' )
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
mtag = '\n<meta http-equiv="Content-Language" content="en"/>\n'
|
||||
soup.head.insert(0,mtag)
|
||||
return soup
|
||||
|
||||
def print_version(self, url):
|
||||
ubody, sep, rest = url.rpartition('/-1/')
|
||||
root, sep2, article_id = ubody.partition('/article/')
|
||||
return u'http://www.honoluluadvertiser.com/apps/pbcs.dll/article?AID=/' + article_id + '&template=printart'
|
||||
|
@ -13,7 +13,7 @@ class JBOnline(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Brasil'
|
||||
oldest_article = 2
|
||||
language = _('Spanish')
|
||||
language = _('Portugese')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -15,6 +15,7 @@ class Nin(BasicNewsRecipe):
|
||||
description = 'Nedeljne informativne novine'
|
||||
no_stylesheets = True
|
||||
oldest_article = 15
|
||||
language = _('Serbian')
|
||||
simultaneous_downloads = 1
|
||||
delay = 1
|
||||
encoding = 'utf8'
|
||||
|
@ -13,6 +13,7 @@ class Novosti(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'novosti, vesti, politika, dosije, drustvo, ekonomija, hronika, reportaze, svet, kultura, sport, beograd, regioni, mozaik, feljton, intrvju, pjer, fudbal, kosarka, podvig, arhiva, komentari, kolumne, srbija, republika srpska,Vecernje novosti'
|
||||
oldest_article = 2
|
||||
language = _('Serbian')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -14,7 +14,7 @@ class OGlobo(BasicNewsRecipe):
|
||||
description = 'News from Brasil'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
language = _('Spanish')
|
||||
language = _('Portugese')
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1252'
|
||||
|
@ -14,6 +14,7 @@ class Pescanik(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Pescanik'
|
||||
oldest_article = 7
|
||||
language = _('Serbian')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -17,7 +17,7 @@ class PetersburgTimes(BasicNewsRecipe):
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
language = _('Russian')
|
||||
language = _('English')
|
||||
INDEX = 'http://www.sptimes.ru'
|
||||
|
||||
def parse_index(self):
|
||||
@ -36,4 +36,4 @@ class PetersburgTimes(BasicNewsRecipe):
|
||||
'url':url,
|
||||
'description':description
|
||||
})
|
||||
return [(soup.head.title.string, articles)]
|
||||
return [(soup.head.title.string, articles)]
|
||||
|
58
src/calibre/web/feeds/recipes/recipe_starbulletin.py
Normal file
58
src/calibre/web/feeds/recipes/recipe_starbulletin.py
Normal file
@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
starbulletin.com
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Starbulletin(BasicNewsRecipe):
|
||||
title = 'Honolulu Star-Bulletin'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = "Latest national and local Hawaii sports news"
|
||||
publisher = 'Honolulu Star-Bulletin'
|
||||
category = 'news, Honolulu, Hawaii'
|
||||
oldest_article = 2
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
encoding = 'utf8'
|
||||
remove_javascript = True
|
||||
cover_url = 'http://media.starbulletin.com/designimages/spacer.gif'
|
||||
|
||||
html2lrf_options = [
|
||||
'--comment' , description
|
||||
, '--category' , category
|
||||
, '--publisher' , publisher
|
||||
]
|
||||
|
||||
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'id':'storyColoumn'}) ]
|
||||
|
||||
remove_tags = [
|
||||
dict(name=['object','link'])
|
||||
,dict(name='span', attrs={'id':'printdesc'})
|
||||
,dict(name='div' , attrs={'class':'lightGreyBox storyTools clearAll'})
|
||||
,dict(name='div' , attrs={'id':'breadcrumbs'})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Headlines', u'http://www.starbulletin.com/starbulletin_headlines.rss' )
|
||||
,(u'News', u'http://www.starbulletin.com/news/index.rss' )
|
||||
,(u'Sports', u'http://www.starbulletin.com/sports/index.rss' )
|
||||
,(u'Features', u'http://www.starbulletin.com/features/index.rss' )
|
||||
,(u'Editorials', u'http://www.starbulletin.com/editorials/index.rss' )
|
||||
,(u'Business', u'http://www.starbulletin.com/business/index.rss' )
|
||||
,(u'Travel', u'http://www.starbulletin.com/travel/index.rss' )
|
||||
]
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
for item in soup.findAll(style=True):
|
||||
del item['style']
|
||||
mtag = '\n<meta http-equiv="Content-Language" content="en"/>\n'
|
||||
soup.head.insert(0,mtag)
|
||||
return soup
|
||||
|
@ -16,6 +16,7 @@ class Vijesti(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'News from Montenegro'
|
||||
oldest_article = 2
|
||||
language = _('Serbian')
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
@ -16,6 +16,7 @@ class Vreme(BasicNewsRecipe):
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Politicki Nedeljnik Srbije'
|
||||
no_stylesheets = True
|
||||
language = _('Serbian')
|
||||
needs_subscription = True
|
||||
INDEX = 'http://www.vreme.com'
|
||||
LOGIN = 'http://www.vreme.com/account/index.php'
|
||||
|
Loading…
x
Reference in New Issue
Block a user