| 1 |
__license__ = 'GPL v3' |
| 2 |
__copyright__ = '2008-2012, Darko Miletic <darko.miletic at gmail.com>' |
| 3 |
''' |
| 4 |
blic.rs |
| 5 |
''' |
| 6 |
|
| 7 |
import re |
| 8 |
|
| 9 |
from calibre.web.feeds.news import BasicNewsRecipe |
| 10 |
|
| 11 |
|
| 12 |
class Blic(BasicNewsRecipe): |
| 13 |
title = 'Blic' |
| 14 |
__author__ = 'Darko Miletic' |
| 15 |
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' # noqa: E501 |
| 16 |
publisher = 'RINGIER d.o.o.' |
| 17 |
category = 'news, politics, Serbia' |
| 18 |
oldest_article = 2 |
| 19 |
max_articles_per_feed = 100 |
| 20 |
no_stylesheets = True |
| 21 |
use_embedded_content = False |
| 22 |
masthead_url = 'http://www.blic.rs/resources/images/header/header_back.png' |
| 23 |
language = 'sr' |
| 24 |
publication_type = 'newspaper' |
| 25 |
extra_css = ''' |
| 26 |
@font-face {font-family: "serif1";src:url(res:///opt/sony/ebook/FONT/tt0011m_.ttf)} |
| 27 |
@font-face {font-family: "sans1";src:url(res:///opt/sony/ebook/FONT/tt0003m_.ttf)} |
| 28 |
body{font-family: Georgia, serif1, serif} |
| 29 |
.articledescription,#nadnaslov,.article_info{font-family: Arial, sans1, sans-serif} |
| 30 |
.img_full{float: none} |
| 31 |
#nadnaslov{font-size: small} |
| 32 |
#article_lead{font-size: 1.5em} |
| 33 |
h1{color: red} |
| 34 |
.potpis{font-size: x-small; color: gray} |
| 35 |
.article_info{font-size: small} |
| 36 |
img{margin-bottom: 0.8em; margin-top: 0.8em; display: block} |
| 37 |
''' |
| 38 |
|
| 39 |
conversion_options = {'comment': description, 'tags': category, 'publisher': publisher, 'language': language, 'linearize_tables': True} |
| 40 |
|
| 41 |
preprocess_regexps = [(re.compile('\u0110'), lambda match: '\u00d0')] # noqa: RUF039 |
| 42 |
remove_tags_before = dict(name='div', attrs={'id': 'article_info'}) |
| 43 |
remove_tags = [dict(name=['object', 'link', 'meta', 'base', 'object', 'embed'])] |
| 44 |
remove_attributes = ['width', 'height', 'm_id', 'm_ext', 'mlg_id', 'poll_id', 'v_id'] |
| 45 |
|
| 46 |
feeds = [ |
| 47 |
('Politika', 'http://www.blic.rs/rss/Vesti/Politika'), |
| 48 |
('Tema Dana', 'http://www.blic.rs/rss/Vesti/Tema-Dana'), |
| 49 |
('Svet', 'http://www.blic.rs/rss/Vesti/Svet'), |
| 50 |
('Drustvo', 'http://www.blic.rs/rss/Vesti/Drustvo'), |
| 51 |
('Ekonomija', 'http://www.blic.rs/rss/Vesti/Ekonomija'), |
| 52 |
('Hronika', 'http://www.blic.rs/rss/Vesti/Hronika'), |
| 53 |
('Beograd', 'http://www.blic.rs/rss/Vesti/Beograd'), |
| 54 |
('Srbija', 'http://www.blic.rs/rss/Vesti/Srbija'), |
| 55 |
('Vojvodina', 'http://www.blic.rs/rss/Vesti/Vojvodina'), |
| 56 |
('Republika Srpska', 'http://www.blic.rs/rss/Vesti/Republika-Srpska'), |
| 57 |
('Reportaza', 'http://www.blic.rs/rss/Vesti/Reportaza'), |
| 58 |
('Dodatak', 'http://www.blic.rs/rss/Vesti/Dodatak'), |
| 59 |
('Zabava', 'http://www.blic.rs/rss/Zabava'), |
| 60 |
('Kultura', 'http://www.blic.rs/rss/Kultura'), |
| 61 |
('Slobodno Vreme', 'http://www.blic.rs/rss/Slobodno-vreme'), |
| 62 |
('IT', 'http://www.blic.rs/rss/IT'), |
| 63 |
('Komentar', 'http://www.blic.rs/rss/Komentar'), |
| 64 |
('Intervju', 'http://www.blic.rs/rss/Intervju'), |
| 65 |
] |
| 66 |
|
| 67 |
def print_version(self, url): |
| 68 |
return url + '/print' |
| 69 |
|
| 70 |
def get_cover_url(self): |
| 71 |
soup = self.index_to_soup('http://www.blic.rs/') |
| 72 |
alink = soup.find('a', attrs={'id': 'blic_naslovna_print'}) |
| 73 |
if alink: |
| 74 |
return 'http://www.blic.rs' + alink['href'] |
| 75 |
return None |