mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Novinite by martin.tsanchev
This commit is contained in:
parent
81645ede53
commit
7c5f137bba
@ -5,7 +5,7 @@ www.independent.co.uk
|
|||||||
'''
|
'''
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||||
|
|
||||||
class TheIndependent(BasicNewsRecipe):
|
class TheIndependent(BasicNewsRecipe):
|
||||||
title = 'The Independent'
|
title = 'The Independent'
|
||||||
@ -67,7 +67,7 @@ class TheIndependent(BasicNewsRecipe):
|
|||||||
|
|
||||||
def get_article_url(self, article):
|
def get_article_url(self, article):
|
||||||
return article.get('guid', None)
|
return article.get('guid', None)
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for item in soup.body.findAll(style=True):
|
for item in soup.body.findAll(style=True):
|
||||||
del item['style']
|
del item['style']
|
||||||
@ -82,5 +82,5 @@ class TheIndependent(BasicNewsRecipe):
|
|||||||
if not item.attrs and not item.contents:
|
if not item.attrs and not item.contents:
|
||||||
item.extract()
|
item.extract()
|
||||||
soup2 = BeautifulSoup('<html><head><title>t</title></head><body></body></html>')
|
soup2 = BeautifulSoup('<html><head><title>t</title></head><body></body></html>')
|
||||||
soup2.body.replaceWith(soup.body)
|
soup2.body.replaceWith(soup.body)
|
||||||
return soup2
|
return soup2
|
||||||
|
35
recipes/novinite.recipe
Normal file
35
recipes/novinite.recipe
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
|
class AdvancedUserRecipe1308572538(BasicNewsRecipe):
|
||||||
|
title = u'Novinite.com'
|
||||||
|
__author__ = 'Martin Tsanchev'
|
||||||
|
description = 'Real time provider of the latest Bulgarian news in English'
|
||||||
|
category = 'Business, Politics, Society, Sports, Crime, Lifestyle, World, People'
|
||||||
|
language = 'en_BG'
|
||||||
|
encoding = 'utf-8'
|
||||||
|
oldest_article = 7
|
||||||
|
max_articles_per_feed = 10
|
||||||
|
keep_only_tags = [dict(name='div', attrs={'id':'content'})]
|
||||||
|
remove_tags = [dict(name='a', attrs={'class':'twitter-share-button'})]
|
||||||
|
remove_tags_after = dict(id='textsize')
|
||||||
|
no_stylesheets = True
|
||||||
|
feeds = [(u'Business', u'http://www.novinite.com/services/news_rdf.php?category_id=1'),
|
||||||
|
(u'Finance', u'http://www.novinite.com/services/news_rdf.php?category_id=15'),
|
||||||
|
(u'Energy', u'http://www.novinite.com/services/news_rdf.php?category_id=16'),
|
||||||
|
(u'Industry', u'http://www.novinite.com/services/news_rdf.php?category_id=17'),
|
||||||
|
(u'Properties', u'http://www.novinite.com/services/news_rdf.php?category_id=18'),
|
||||||
|
(u'Politics', u'http://www.novinite.com/services/news_rdf.php?category_id=2'),
|
||||||
|
(u'Diplomacy', u'http://www.novinite.com/services/news_rdf.php?category_id=20'),
|
||||||
|
(u'Defense', u'http://www.novinite.com/services/news_rdf.php?category_id=21'),
|
||||||
|
(u'Bulgaria in EU', u'http://www.novinite.com/services/news_rdf.php?category_id=22'),
|
||||||
|
(u'Domestic', u'http://www.novinite.com/services/news_rdf.php?category_id=23'),
|
||||||
|
(u'Society', u'http://www.novinite.com/services/news_rdf.php?category_id=3'),
|
||||||
|
(u'Environment', u'http://www.novinite.com/services/news_rdf.php?category_id=24'),
|
||||||
|
(u'Education', u'http://www.novinite.com/services/news_rdf.php?category_id=25'),
|
||||||
|
(u'Culture', u'http://www.novinite.com/services/news_rdf.php?category_id=26'),
|
||||||
|
(u'Archaeology', u'http://www.novinite.com/services/news_rdf.php?category_id=34'),
|
||||||
|
(u'Health', u'http://www.novinite.com/services/news_rdf.php?category_id=62'),
|
||||||
|
(u'Sports', u'http://www.novinite.com/services/news_rdf.php?category_id=4'),
|
||||||
|
(u'Crime', u'http://www.novinite.com/services/news_rdf.php?category_id=5'),
|
||||||
|
(u'Lifestyle', u'http://www.novinite.com/services/news_rdf.php?category_id=6'),
|
||||||
|
(u'World', u'http://www.novinite.com/services/news_rdf.php?category_id=30')]
|
@ -112,6 +112,7 @@ _extra_lang_codes = {
|
|||||||
'zh_TW' : _('Traditional Chinese'),
|
'zh_TW' : _('Traditional Chinese'),
|
||||||
'en' : _('English'),
|
'en' : _('English'),
|
||||||
'en_AU' : _('English (Australia)'),
|
'en_AU' : _('English (Australia)'),
|
||||||
|
'en_BG' : _('English (Bulgaria)'),
|
||||||
'en_NZ' : _('English (New Zealand)'),
|
'en_NZ' : _('English (New Zealand)'),
|
||||||
'en_CA' : _('English (Canada)'),
|
'en_CA' : _('English (Canada)'),
|
||||||
'en_GR' : _('English (Greece)'),
|
'en_GR' : _('English (Greece)'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user