mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/jony0008/calibre
This commit is contained in:
commit
f8447df256
@ -1,73 +0,0 @@
|
|||||||
#!/usr/bin/env python2
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__author__ = 'Gabriele Marini, based on Darko Miletic'
|
|
||||||
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
|
||||||
description = 'Italian daily newspaper - 01-05-2010'
|
|
||||||
'''
|
|
||||||
http://www.ansa.it/
|
|
||||||
'''
|
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
|
|
||||||
|
|
||||||
class Ansa(BasicNewsRecipe):
|
|
||||||
__author__ = 'Gabriele Marini'
|
|
||||||
description = 'Italian News Agency'
|
|
||||||
|
|
||||||
cover_url = 'http://www.ansa.it/web/images/logo_ansa_interna.gif'
|
|
||||||
title = u'Ansa'
|
|
||||||
publisher = 'Ansa'
|
|
||||||
category = 'News, politics, culture, economy, general interest'
|
|
||||||
|
|
||||||
language = 'it'
|
|
||||||
timefmt = '[%a, %d %b, %Y]'
|
|
||||||
|
|
||||||
oldest_article = 1
|
|
||||||
max_articles_per_feed = 10
|
|
||||||
use_embedded_content = False
|
|
||||||
recursion = 10
|
|
||||||
|
|
||||||
remove_javascript = True
|
|
||||||
no_stylesheets = True
|
|
||||||
conversion_options = {'linearize_tables': True}
|
|
||||||
remove_attributes = ['colspan']
|
|
||||||
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class': ['path', 'header-content', 'corpo']}),
|
|
||||||
]
|
|
||||||
|
|
||||||
remove_tags = [
|
|
||||||
dict(name='div', attrs={'class': 'tools-bar'}),
|
|
||||||
dict(name='div', attrs={'id': ['rssdiv', 'blocco']})
|
|
||||||
]
|
|
||||||
|
|
||||||
feeds = [
|
|
||||||
(u'HomePage', u'http://www.ansa.it/web/ansait_web_rss_homepage.xml'),
|
|
||||||
(u'Top New', u'http://www.ansa.it/web/notizie/rubriche/topnews/topnews_rss.xml'),
|
|
||||||
(u'Cronaca', u'http://www.ansa.it/web/notizie/rubriche/cronaca/cronaca_rss.xml'),
|
|
||||||
(u'Mondo', u'http://www.ansa.it/web/notizie/rubriche/mondo/mondo_rss.xml'),
|
|
||||||
(u'Economia', u'http://www.ansa.it/web/notizie/rubriche/economia/economia_rss.xml'),
|
|
||||||
(u'Politica', u'http://www.ansa.it/web/notizie/rubriche/politica/politica_rss.xml'),
|
|
||||||
(u'Scienze', u'http://www.ansa.it/web/notizie/rubriche/scienza/scienza_rss.xml'),
|
|
||||||
(u'Cinema', u'http://www.ansa.it/web/notizie/rubriche/cinema/cinema_rss.xml'),
|
|
||||||
(u'Tecnologia e Internet',
|
|
||||||
u'http://www.ansa.it/web/notizie/rubriche/tecnologia/tecnologia_rss.xml'),
|
|
||||||
(u'Spettacolo', u'http://www.ansa.it/web/notizie/rubriche/spettacolo/spettacolo_rss.xml'),
|
|
||||||
(u'Cultura e Tendenze',
|
|
||||||
u'http://www.ansa.it/web/notizie/rubriche/cultura/cultura_rss.xml'),
|
|
||||||
(u'Sport', u'http://www.ansa.it/web/notizie/rubriche/altrisport/altrisport_rss.xml'),
|
|
||||||
(u'Calcio', u'http://www.ansa.it/web/notizie/rubriche/calcio/calcio_rss.xml'),
|
|
||||||
(u'Lazio', u'http://www.ansa.it/web/notizie/regioni/lazio/lazio_rss.xml'),
|
|
||||||
(u'Lombardia', u'http://www.ansa.it/web/notizie/regioni/lombardia/lombardia.shtml'),
|
|
||||||
(u'Veneto', u'http://www.ansa.it/web/notizie/regioni/veneto/veneto.shtml'),
|
|
||||||
(u'Campanioa', u'http://www.ansa.it/web/notizie/regioni/campania/campania.shtml'),
|
|
||||||
(u'Sicilia', u'http://www.ansa.it/web/notizie/regioni/sicilia/sicilia.shtml'),
|
|
||||||
(u'Toscana', u'http://www.ansa.it/web/notizie/regioni/toscana/toscana.shtml'),
|
|
||||||
(u'Trentino', u'http://www.ansa.it/web/notizie/regioni/trentino/trentino.shtml')
|
|
||||||
]
|
|
||||||
|
|
||||||
extra_css = '''
|
|
||||||
.path{font-style: italic; font-size: small}
|
|
||||||
.header-content h1{font-weight: bold; font-size: xx-large}
|
|
||||||
.header-content h2{font-weight: bold; font-size: x-large; font-syle: italic}
|
|
||||||
.content-corpo{font-size: 14px;font-family: Times New Roman;}
|
|
||||||
'''
|
|
@ -1,80 +0,0 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
|
||||||
__copyright__ = '2010, Darko Miletic <darko.miletic at gmail.com>'
|
|
||||||
'''
|
|
||||||
bhdani.com
|
|
||||||
'''
|
|
||||||
|
|
||||||
import re
|
|
||||||
from calibre import strftime
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
|
|
||||||
|
|
||||||
class BHDani(BasicNewsRecipe):
|
|
||||||
title = 'Dani'
|
|
||||||
__author__ = 'Darko Miletic'
|
|
||||||
description = 'On line izdanje najutjecajnijeg bosanskohercegovackog magazina'
|
|
||||||
publisher = 'd.o.o. CIVITAS'
|
|
||||||
category = 'dani, bh, bhdani, magazin, sarajevo, bosna, novine, mediji, listovi, news, magazines, weekly'
|
|
||||||
no_stylesheets = True
|
|
||||||
oldest_article = 15
|
|
||||||
encoding = 'cp1250'
|
|
||||||
needs_subscription = True
|
|
||||||
remove_empty_feeds = True
|
|
||||||
PREFIX = 'http://bhdani.com'
|
|
||||||
INDEX = PREFIX + '/'
|
|
||||||
LOGIN = PREFIX + '/users/login.asp'
|
|
||||||
use_embedded_content = False
|
|
||||||
language = 'bs'
|
|
||||||
publication_type = 'magazine'
|
|
||||||
extra_css = ' @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: Arial, sans1, sans-serif} .article_description{font-family: Arial, sans1, sans-serif} .plv18{font-size: xx-large; font-weight: bold; color: #5261A9} .crn10{font-weight: bold} ' # noqa
|
|
||||||
|
|
||||||
conversion_options = {
|
|
||||||
'comment': description, 'tags': category, 'publisher': publisher, 'language': language, 'linearize_tables': True
|
|
||||||
}
|
|
||||||
|
|
||||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
|
||||||
remove_attributes = ['height', 'width', 'align']
|
|
||||||
|
|
||||||
def get_browser(self):
|
|
||||||
br = BasicNewsRecipe.get_browser(self)
|
|
||||||
if self.username is not None and self.password is not None:
|
|
||||||
br.open(self.INDEX)
|
|
||||||
br.select_form(name='form')
|
|
||||||
br['username'] = self.username
|
|
||||||
br['password'] = self.password
|
|
||||||
br.submit()
|
|
||||||
return br
|
|
||||||
|
|
||||||
remove_tags = [dict(name=['link', 'embed', 'object', 'iframe', 'form'])]
|
|
||||||
remove_tags_before = dict(name='div', attrs={'class': 'crn10'})
|
|
||||||
|
|
||||||
def get_cover_url(self):
|
|
||||||
cover_url = None
|
|
||||||
soup = self.index_to_soup(self.INDEX)
|
|
||||||
link_item = soup.find('img', attrs={'alt': 'Naslovna strana'})
|
|
||||||
if link_item:
|
|
||||||
cover_url = self.PREFIX + \
|
|
||||||
link_item['src'].replace(
|
|
||||||
'&slika=slika120&', '&slika=slika400&')
|
|
||||||
return cover_url
|
|
||||||
|
|
||||||
def print_version(self, url):
|
|
||||||
return url.replace('/default.asp?', '/print.asp?')
|
|
||||||
|
|
||||||
def parse_index(self):
|
|
||||||
articles = []
|
|
||||||
soup = self.index_to_soup(self.PREFIX)
|
|
||||||
nrtit = soup.find('font', attrs={'class': 'broj'})
|
|
||||||
nrtitle = 'Dani'
|
|
||||||
if nrtit:
|
|
||||||
nrtitle += ' ' + self.tag_to_string(nrtit)
|
|
||||||
for item in soup.findAll('a', attrs={'class': ['naslov12', 'menilink2']}):
|
|
||||||
url = self.PREFIX + item['href']
|
|
||||||
title = self.tag_to_string(item)
|
|
||||||
description = ''
|
|
||||||
date = strftime(self.timefmt)
|
|
||||||
articles.append({
|
|
||||||
'title': title, 'date': date, 'url': url, 'description': description
|
|
||||||
})
|
|
||||||
return [(nrtitle, articles)]
|
|
@ -1,28 +0,0 @@
|
|||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
|
||||||
|
|
||||||
|
|
||||||
class AdvancedUserRecipe1329123365(BasicNewsRecipe):
|
|
||||||
title = u'Mobilebulgaria.com'
|
|
||||||
__author__ = 'M3 Web'
|
|
||||||
description = 'The biggest Bulgarian site covering mobile consumer electronics. Offers detailed reviews, popular discussion forum, shop and platform for selling new and second hand phones and gadgets.' # noqa
|
|
||||||
category = 'News, Reviews, Offers, Forum'
|
|
||||||
oldest_article = 45
|
|
||||||
max_articles_per_feed = 10
|
|
||||||
language = 'bg'
|
|
||||||
encoding = 'windows-1251'
|
|
||||||
no_stylesheets = False
|
|
||||||
remove_javascript = True
|
|
||||||
keep_only_tags = [dict(name='div', attrs={'class': 'bigblock'}),
|
|
||||||
dict(name='div', attrs={'class': 'verybigblock'}),
|
|
||||||
dict(name='table', attrs={'class': 'obiaviresults'}),
|
|
||||||
dict(name='div', attrs={'class': 'forumblock'}),
|
|
||||||
dict(name='div', attrs={'class': 'forumblock_b1'}),
|
|
||||||
dict(name='div', attrs={'class': 'block2_2colswrap'})]
|
|
||||||
|
|
||||||
feeds = [(u'News', u'http://www.mobilebulgaria.com/rss_full.php'),
|
|
||||||
(u'Reviews', u'http://www.mobilebulgaria.com/rss_reviews.php'),
|
|
||||||
(u'Offers', u'http://www.mobilebulgaria.com/obiavi/rss.php'),
|
|
||||||
(u'Forum', u'http://www.mobilebulgaria.com/rss_forum_last10.php')]
|
|
||||||
|
|
||||||
extra_css = '''
|
|
||||||
#gallery1 div{display: block; float: left; margin: 0 10px 10px 0;} '''
|
|
Loading…
x
Reference in New Issue
Block a user