mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for Press by Darko Miletic
This commit is contained in:
parent
1d5aaaf830
commit
e5b151aa69
@ -310,6 +310,8 @@ def create_cover_image(src, dest, screen_size, rescale_cover=True):
|
|||||||
def process_title_page(mi, filelist, htmlfilemap, opts, tdir):
|
def process_title_page(mi, filelist, htmlfilemap, opts, tdir):
|
||||||
old_title_page = None
|
old_title_page = None
|
||||||
f = lambda x : os.path.normcase(os.path.normpath(x))
|
f = lambda x : os.path.normcase(os.path.normpath(x))
|
||||||
|
if not isinstance(mi.cover, basestring):
|
||||||
|
mi.cover = None
|
||||||
if mi.cover:
|
if mi.cover:
|
||||||
if f(filelist[0].path) == f(mi.cover):
|
if f(filelist[0].path) == f(mi.cover):
|
||||||
old_title_page = htmlfilemap[filelist[0].path]
|
old_title_page = htmlfilemap[filelist[0].path]
|
||||||
|
BIN
src/calibre/gui2/images/news/pressonline.png
Normal file
BIN
src/calibre/gui2/images/news/pressonline.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
@ -29,7 +29,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz',
|
'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz',
|
||||||
'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna',
|
'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna',
|
||||||
'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices',
|
'pobjeda', 'chicago_breaking_news', 'glasgow_herald', 'linuxdevices',
|
||||||
'hindu', 'cincinnati_enquirer', 'physics_world',
|
'hindu', 'cincinnati_enquirer', 'physics_world', 'pressonline',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
import re, imp, inspect, time, os
|
import re, imp, inspect, time, os
|
||||||
|
67
src/calibre/web/feeds/recipes/recipe_pressonline.py
Normal file
67
src/calibre/web/feeds/recipes/recipe_pressonline.py
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
|
||||||
|
'''
|
||||||
|
pressonline.rs
|
||||||
|
'''
|
||||||
|
|
||||||
|
import re
|
||||||
|
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||||
|
|
||||||
|
class PressOnline(BasicNewsRecipe):
|
||||||
|
title = 'Press Online'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Press Online portal dnevnih novina Press.Najnovije vesti iz Srbije i sveta,Sport,Dzet Set,Politika,Hronika,Komenteri,Zabava,Slike,Video,Horoskop,Nagradne igre,Kvizovi,Igrice'
|
||||||
|
publisher = 'Press Publishing group'
|
||||||
|
category = 'news, politics, Serbia'
|
||||||
|
oldest_article = 2
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
encoding = 'utf8'
|
||||||
|
use_embedded_content = True
|
||||||
|
cover_url = 'http://www.pressonline.rs/img/logo.gif'
|
||||||
|
language = _('Serbian')
|
||||||
|
|
||||||
|
extra_css = '@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} body{font-family: serif1, serif} .article_description{font-family: serif1, serif}'
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment', description
|
||||||
|
, '--category', category
|
||||||
|
, '--publisher', publisher
|
||||||
|
]
|
||||||
|
|
||||||
|
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||||
|
|
||||||
|
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||||
|
|
||||||
|
feeds = [
|
||||||
|
(u'Vesti Dana' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=37')
|
||||||
|
,(u'Politika' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=29')
|
||||||
|
,(u'U Fokusu' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=33')
|
||||||
|
,(u'Globus' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=40')
|
||||||
|
,(u'Komentar Dana' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=62')
|
||||||
|
,(u'Hronika' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=39')
|
||||||
|
,(u'Regioni' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=56')
|
||||||
|
,(u'Republika Srpska', u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=51')
|
||||||
|
,(u'Beograd' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=43')
|
||||||
|
,(u'Dzet-Set Svet' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=41')
|
||||||
|
,(u'Lifestyle' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=42')
|
||||||
|
,(u'Sport' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=44')
|
||||||
|
,(u'Press Magazine' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=63')
|
||||||
|
,(u'Lola' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=70')
|
||||||
|
,(u'Duplerica' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=72')
|
||||||
|
,(u'Presspedia' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=80')
|
||||||
|
,(u'Kolumne' , u'http://www.pressonline.rs/page/stories/sr.html?view=rss§ionId=57')
|
||||||
|
]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
soup.html['xml:lang'] = 'sr-Latn-RS'
|
||||||
|
soup.html['lang'] = 'sr-Latn-RS'
|
||||||
|
mtag = '<meta http-equiv="Content-Language" content="sr-Latn-RS"/>\n<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'
|
||||||
|
soup.head.insert(0,mtag)
|
||||||
|
img = soup.find('img')
|
||||||
|
if img:
|
||||||
|
del img['align']
|
||||||
|
return soup
|
Loading…
x
Reference in New Issue
Block a user