mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Updated serbian and croation recipes
This commit is contained in:
parent
642ac41a57
commit
acf525d22d
BIN
src/calibre/gui2/images/news/b92.png
Normal file
BIN
src/calibre/gui2/images/news/b92.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 413 B |
BIN
src/calibre/gui2/images/news/blic.png
Normal file
BIN
src/calibre/gui2/images/news/blic.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 738 B |
BIN
src/calibre/gui2/images/news/danas.png
Normal file
BIN
src/calibre/gui2/images/news/danas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 709 B |
BIN
src/calibre/gui2/images/news/jutarnji.png
Normal file
BIN
src/calibre/gui2/images/news/jutarnji.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 988 B |
BIN
src/calibre/gui2/images/news/novosti.png
Normal file
BIN
src/calibre/gui2/images/news/novosti.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 281 B |
BIN
src/calibre/gui2/images/news/politika.png
Normal file
BIN
src/calibre/gui2/images/news/politika.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 362 B |
@ -5,7 +5,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
b92.net
|
||||
'''
|
||||
import locale
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class B92(BasicNewsRecipe):
|
||||
@ -17,6 +17,8 @@ class B92(BasicNewsRecipe):
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
remove_tags_after = dict(name='div', attrs={'class':'gas'})
|
||||
remove_tags = [
|
||||
dict(name='div' , attrs={'class':'interaction clearfix' })
|
||||
|
@ -5,7 +5,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
blic.rs
|
||||
'''
|
||||
import locale
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Blic(BasicNewsRecipe):
|
||||
@ -18,6 +18,8 @@ class Blic(BasicNewsRecipe):
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'class':'single_news'}) ]
|
||||
|
||||
feeds = [ (u'Vesti', u'http://www.blic.rs/rssall.php')]
|
||||
|
@ -5,7 +5,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
danas.rs
|
||||
'''
|
||||
import locale
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Danas(BasicNewsRecipe):
|
||||
@ -14,10 +14,12 @@ class Danas(BasicNewsRecipe):
|
||||
description = 'Vesti'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = False
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'id':'left'}) ]
|
||||
remove_tags_after = dict(name='div', attrs={'id':'comments'})
|
||||
remove_tags = [
|
||||
@ -30,6 +32,3 @@ class Danas(BasicNewsRecipe):
|
||||
|
||||
|
||||
feeds = [ (u'Vesti', u'http://www.danas.rs/rss/rss.asp')]
|
||||
|
||||
# def print_version(self, url):
|
||||
# return url + '&action=print'
|
||||
|
@ -6,7 +6,9 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
jutarnji.hr
|
||||
'''
|
||||
|
||||
import string, re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup
|
||||
|
||||
class Jutarnji(BasicNewsRecipe):
|
||||
title = u'Jutarnji'
|
||||
@ -18,6 +20,8 @@ class Jutarnji(BasicNewsRecipe):
|
||||
use_embedded_content = False
|
||||
encoding = 'cp1250'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
remove_tags = [dict(name='embed')]
|
||||
|
||||
feeds = [
|
||||
@ -31,8 +35,8 @@ class Jutarnji(BasicNewsRecipe):
|
||||
]
|
||||
|
||||
def print_version(self, url):
|
||||
main = url.partition('.jl')[0]
|
||||
rrest = main.rpartition(',')[-1]
|
||||
main, split, rest = url.partition('.jl')
|
||||
rmain, rsplit, rrest = main.rpartition(',')
|
||||
return 'http://www.jutarnji.hr/ispis_clanka.jl?artid=' + rrest
|
||||
|
||||
def preprocess_html(self, soup):
|
||||
|
@ -5,7 +5,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
novosti.rs
|
||||
'''
|
||||
import locale
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Novosti(BasicNewsRecipe):
|
||||
@ -18,6 +18,8 @@ class Novosti(BasicNewsRecipe):
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'class':'jednaVest'}) ]
|
||||
remove_tags_after = dict(name='div', attrs={'class':'info_bottom'})
|
||||
remove_tags = [
|
||||
|
33
src/calibre/web/feeds/recipes/nspm.py
Normal file
33
src/calibre/web/feeds/recipes/nspm.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
nspm.rs
|
||||
'''
|
||||
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Nspm(BasicNewsRecipe):
|
||||
title = u'Nova srpska politicka misao'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Casopis za politicku teoriju i drustvena istrazivanja'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
INDEX = 'http://www.nspm.rs/?alphabet=l'
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser()
|
||||
br.open(self.INDEX)
|
||||
return br
|
||||
|
||||
feeds = [ (u'Nova srpska politicka misao', u'http://www.nspm.rs/feed/rss.html')]
|
||||
|
||||
def print_version(self, url):
|
||||
return url.replace('.html','/stampa.html')
|
@ -5,7 +5,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
politika.rs
|
||||
'''
|
||||
import locale
|
||||
import string,re
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Politika(BasicNewsRecipe):
|
||||
@ -18,6 +18,9 @@ class Politika(BasicNewsRecipe):
|
||||
extra_css = '.content_center_border {text-align: left;}'
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
remove_tags_before = dict(name='div', attrs={'class':'content_center_border'})
|
||||
remove_tags_after = dict(name='div', attrs={'class':'datum_item_details'})
|
||||
|
||||
|
@ -6,8 +6,7 @@ __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
vreme.com
|
||||
'''
|
||||
|
||||
import string
|
||||
import locale
|
||||
import string,re
|
||||
from calibre import strftime
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
@ -24,6 +23,8 @@ class Vreme(BasicNewsRecipe):
|
||||
INDEX = 'http://www.vreme.com'
|
||||
LOGIN = 'http://www.vreme.com/account/index.php'
|
||||
|
||||
preprocess_regexps = [(re.compile(u'\u0110'), lambda match: u'\u00D0')]
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser()
|
||||
if self.username is not None and self.password is not None:
|
||||
@ -39,16 +40,29 @@ class Vreme(BasicNewsRecipe):
|
||||
soup = self.index_to_soup(self.INDEX)
|
||||
|
||||
for item in soup.findAll('span', attrs={'class':'toc2'}):
|
||||
description = ''
|
||||
title_prefix = ''
|
||||
|
||||
descript_title_tag = item.findPreviousSibling('span', attrs={'class':'toc1'})
|
||||
if descript_title_tag:
|
||||
title_prefix = self.tag_to_string(descript_title_tag) + ' '
|
||||
|
||||
descript_tag = item.findNextSibling('span', attrs={'class':'toc3'})
|
||||
if descript_tag:
|
||||
description = self.tag_to_string(descript_tag)
|
||||
|
||||
feed_link = item.find('a')
|
||||
if feed_link and feed_link.has_key('href'):
|
||||
url = self.INDEX+feed_link['href']+'&print=yes'
|
||||
title = self.tag_to_string(feed_link)
|
||||
date = strftime('%A, %d %B, %Y')
|
||||
description = ''
|
||||
url = self.INDEX + feed_link['href']
|
||||
title = title_prefix + self.tag_to_string(feed_link)
|
||||
date = strftime(self.timefmt)
|
||||
articles.append({
|
||||
'title':title,
|
||||
'date':date,
|
||||
'url':url,
|
||||
'description':description
|
||||
'title' :title
|
||||
,'date' :date
|
||||
,'url' :url
|
||||
,'description':description
|
||||
})
|
||||
return [(soup.head.title.string, articles)]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + '&print=yes'
|
||||
|
Loading…
x
Reference in New Issue
Block a user