mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
New recipe for BETA by Darko Miletic
This commit is contained in:
parent
50f29176cb
commit
1a35d88952
BIN
src/calibre/gui2/images/news/beta.png
Normal file
BIN
src/calibre/gui2/images/news/beta.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 670 B |
BIN
src/calibre/gui2/images/news/beta_en.png
Normal file
BIN
src/calibre/gui2/images/news/beta_en.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 670 B |
@ -54,7 +54,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'fastcompany', 'accountancyage', 'laprensa_hn', 'latribuna',
|
'fastcompany', 'accountancyage', 'laprensa_hn', 'latribuna',
|
||||||
'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress',
|
'eltiempo_hn', 'slate', 'tnxm', 'bbcvietnamese', 'vnexpress',
|
||||||
'volksrant', 'theeconomictimes_india', 'ourdailybread',
|
'volksrant', 'theeconomictimes_india', 'ourdailybread',
|
||||||
'monitor', 'republika',
|
'monitor', 'republika', 'beta', 'beta_en',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
|
||||||
|
50
src/calibre/web/feeds/recipes/recipe_beta.py
Normal file
50
src/calibre/web/feeds/recipes/recipe_beta.py
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
beta.rs
|
||||||
|
'''
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||||
|
|
||||||
|
class Danas(BasicNewsRecipe):
|
||||||
|
title = 'BETA'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Novinska Agencija'
|
||||||
|
publisher = 'Beta'
|
||||||
|
category = 'news, politics, Serbia'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = False
|
||||||
|
use_embedded_content = True
|
||||||
|
language = _('Serbian')
|
||||||
|
lang = 'sr-Latn-RS'
|
||||||
|
direction = 'ltr'
|
||||||
|
extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} @font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: sans1, sans-serif}'
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher' : publisher
|
||||||
|
, 'language' : lang
|
||||||
|
, 'pretty_print' : True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Vesti dana', u'http://www.beta.rs/rssvd.asp')
|
||||||
|
,(u'Ekonomija' , u'http://www.beta.rs/rssek.asp')
|
||||||
|
,(u'Sport' , u'http://www.beta.rs/rsssp.asp')
|
||||||
|
]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
soup.html['lang'] = self.lang
|
||||||
|
mlang = Tag(soup,'meta',[("http-equiv","Content-Language"),("content",self.lang)])
|
||||||
|
mcharset = Tag(soup,'meta',[("http-equiv","Content-Type"),("content","text/html; charset=utf-8")])
|
||||||
|
soup.head.insert(0,mlang)
|
||||||
|
soup.head.insert(1,mcharset)
|
||||||
|
return self.adeify_images(soup)
|
37
src/calibre/web/feeds/recipes/recipe_beta_en.py
Normal file
37
src/calibre/web/feeds/recipes/recipe_beta_en.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
beta.rs
|
||||||
|
'''
|
||||||
|
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||||
|
|
||||||
|
class Danas(BasicNewsRecipe):
|
||||||
|
title = 'BETA - English'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Serbian news agency'
|
||||||
|
publisher = 'Beta'
|
||||||
|
category = 'news, politics, Serbia'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = False
|
||||||
|
use_embedded_content = True
|
||||||
|
language = _('English')
|
||||||
|
lang = 'en'
|
||||||
|
|
||||||
|
conversion_options = {
|
||||||
|
'comment' : description
|
||||||
|
, 'tags' : category
|
||||||
|
, 'publisher' : publisher
|
||||||
|
, 'language' : lang
|
||||||
|
, 'pretty_print' : True
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
feeds = [(u'News', u'http://www.beta.rs/rssen.asp')]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
return self.adeify_images(soup)
|
Loading…
x
Reference in New Issue
Block a user