mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:More serbian recipes
This commit is contained in:
parent
59b0ac6762
commit
bcd4a9d98c
@ -14,6 +14,7 @@ recipe_modules = [
|
||||
'politika', 'moscow_times', 'latimes', 'japan_times', 'san_fran_chronicle',
|
||||
'demorgen_be', 'de_standaard', 'ap', 'barrons', 'chr_mon', 'cnn', 'faznet',
|
||||
'jpost', 'jutarnji', 'nasa', 'reuters', 'spiegelde', 'wash_post', 'zeitde',
|
||||
'blic', 'novosti', 'danas', 'vreme',
|
||||
]
|
||||
|
||||
import re, imp, inspect, time, os
|
||||
|
@ -1,38 +1,60 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
b92.net
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class B92(BasicNewsRecipe):
|
||||
title = u'B92'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Dnevne vesti iz Srbije i sveta'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
|
||||
remove_tags_after = dict(name='div', attrs={'class':'gas'})
|
||||
remove_tags = [
|
||||
dict(name='div' , attrs={'class':'interaction clearfix' })
|
||||
,dict(name='div' , attrs={'class':'gas' })
|
||||
,dict(name='ul' , attrs={'class':'comment-nav' })
|
||||
,dict(name='table', attrs={'class':'pages-navigation-form'})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Vesti' , u'http://www.b92.net/info/rss/vesti.xml' )
|
||||
,(u'Kultura' , u'http://www.b92.net/info/rss/kultura.xml' )
|
||||
,(u'Automobili', u'http://www.b92.net/info/rss/automobili.xml')
|
||||
,(u'Zivot' , u'http://www.b92.net/info/rss/zivot.xml' )
|
||||
,(u'Tehnopolis', u'http://www.b92.net/info/rss/tehnopolis.xml')
|
||||
,(u'Biz' , u'http://www.b92.net/info/rss/biz.xml' )
|
||||
]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + '&version=print'
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
b92.net
|
||||
'''
|
||||
import locale
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class B92(BasicNewsRecipe):
|
||||
title = u'B92'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Dnevne vesti iz Srbije i sveta'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
remove_tags_after = dict(name='div', attrs={'class':'gas'})
|
||||
remove_tags = [
|
||||
dict(name='div' , attrs={'class':'interaction clearfix' })
|
||||
,dict(name='div' , attrs={'class':'gas' })
|
||||
,dict(name='ul' , attrs={'class':'comment-nav' })
|
||||
,dict(name='table', attrs={'class':'pages-navigation-form'})
|
||||
]
|
||||
|
||||
feeds = [
|
||||
(u'Vesti' , u'http://www.b92.net/info/rss/vesti.xml' )
|
||||
,(u'Kultura' , u'http://www.b92.net/info/rss/kultura.xml' )
|
||||
,(u'Automobili', u'http://www.b92.net/info/rss/automobili.xml')
|
||||
,(u'Zivot' , u'http://www.b92.net/info/rss/zivot.xml' )
|
||||
,(u'Tehnopolis', u'http://www.b92.net/info/rss/tehnopolis.xml')
|
||||
,(u'Biz' , u'http://www.b92.net/info/rss/biz.xml' )
|
||||
]
|
||||
|
||||
def print_version(self, url):
|
||||
return url + '&version=print'
|
||||
|
49
src/calibre/web/feeds/recipes/blic.py
Normal file
49
src/calibre/web/feeds/recipes/blic.py
Normal file
@ -0,0 +1,49 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
blic.rs
|
||||
'''
|
||||
import locale
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Blic(BasicNewsRecipe):
|
||||
title = u'Blic'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Vesti'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'class':'single_news'}) ]
|
||||
|
||||
feeds = [ (u'Vesti', u'http://www.blic.rs/rssall.php')]
|
||||
|
||||
def print_version(self, url):
|
||||
start_url, question, rest_url = url.partition('?')
|
||||
return u'http://www.blic.rs/_print.php?' + rest_url
|
57
src/calibre/web/feeds/recipes/danas.py
Normal file
57
src/calibre/web/feeds/recipes/danas.py
Normal file
@ -0,0 +1,57 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
danas.rs
|
||||
'''
|
||||
import locale
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Danas(BasicNewsRecipe):
|
||||
title = u'Danas'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Vesti'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = False
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'id':'left'}) ]
|
||||
remove_tags_after = dict(name='div', attrs={'id':'comments'})
|
||||
remove_tags = [
|
||||
dict(name='div', attrs={'class':'width_1_4'})
|
||||
,dict(name='div', attrs={'class':'metaClanka'})
|
||||
,dict(name='div', attrs={'id':'comments'})
|
||||
,dict(name='div', attrs={'class':'baner'})
|
||||
]
|
||||
|
||||
|
||||
|
||||
feeds = [ (u'Vesti', u'http://www.danas.rs/rss/rss.asp')]
|
||||
|
||||
# def print_version(self, url):
|
||||
# return url + '&action=print'
|
51
src/calibre/web/feeds/recipes/novosti.py
Normal file
51
src/calibre/web/feeds/recipes/novosti.py
Normal file
@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
novosti.rs
|
||||
'''
|
||||
import locale
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Novosti(BasicNewsRecipe):
|
||||
title = u'Vecernje Novosti'
|
||||
__author__ = u'Darko Miletic'
|
||||
description = u'Vesti'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
|
||||
keep_only_tags = [ dict(name='div', attrs={'class':'jednaVest'}) ]
|
||||
remove_tags_after = dict(name='div', attrs={'class':'info_bottom'})
|
||||
remove_tags = [
|
||||
dict(name='div', attrs={'class':'info'})
|
||||
,dict(name='div', attrs={'class':'info_bottom'})
|
||||
]
|
||||
|
||||
feeds = [ (u'Vesti', u'http://www.novosti.rs/php/vesti/rss.php')]
|
@ -1,33 +1,56 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
politika.rs
|
||||
'''
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Politika(BasicNewsRecipe):
|
||||
title = u'Politika Online'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Najstariji dnevni list na Balkanu'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
extra_css = '.content_center_border {text-align: left;}'
|
||||
use_embedded_content = False
|
||||
|
||||
remove_tags_before = dict(name='div', attrs={'class':'content_center_border'})
|
||||
remove_tags_after = dict(name='div', attrs={'class':'datum_item_details'})
|
||||
|
||||
feeds = [
|
||||
(u'Politika' , u'http://www.politika.rs/rubrike/Politika/index.1.lt.xml' )
|
||||
,(u'Svet' , u'http://www.politika.rs/rubrike/Svet/index.1.lt.xml' )
|
||||
,(u'Redakcijski komentari', u'http://www.politika.rs/rubrike/redakcijski-komentari/index.1.lt.xml')
|
||||
,(u'Pogledi' , u'http://www.politika.rs/pogledi/index.lt.xml' )
|
||||
,(u'Pogledi sa strane' , u'http://www.politika.rs/rubrike/Pogledi-sa-strane/index.1.lt.xml' )
|
||||
,(u'Tema dana' , u'http://www.politika.rs/rubrike/tema-dana/index.1.lt.xml' )
|
||||
,(u'Kultura' , u'http://www.politika.rs/rubrike/Kultura/index.1.lt.xml' )
|
||||
,(u'Zivot i stil' , u'http://www.politika.rs/rubrike/zivot-i-stil/index.1.lt.xml' )
|
||||
]
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
politika.rs
|
||||
'''
|
||||
import locale
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Politika(BasicNewsRecipe):
|
||||
title = u'Politika Online'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Najstariji dnevni list na Balkanu'
|
||||
oldest_article = 7
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
extra_css = '.content_center_border {text-align: left;}'
|
||||
use_embedded_content = False
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
remove_tags_before = dict(name='div', attrs={'class':'content_center_border'})
|
||||
remove_tags_after = dict(name='div', attrs={'class':'datum_item_details'})
|
||||
|
||||
feeds = [
|
||||
(u'Politika' , u'http://www.politika.rs/rubrike/Politika/index.1.lt.xml' )
|
||||
,(u'Svet' , u'http://www.politika.rs/rubrike/Svet/index.1.lt.xml' )
|
||||
,(u'Redakcijski komentari', u'http://www.politika.rs/rubrike/redakcijski-komentari/index.1.lt.xml')
|
||||
,(u'Pogledi' , u'http://www.politika.rs/pogledi/index.lt.xml' )
|
||||
,(u'Pogledi sa strane' , u'http://www.politika.rs/rubrike/Pogledi-sa-strane/index.1.lt.xml' )
|
||||
,(u'Tema dana' , u'http://www.politika.rs/rubrike/tema-dana/index.1.lt.xml' )
|
||||
,(u'Kultura' , u'http://www.politika.rs/rubrike/Kultura/index.1.lt.xml' )
|
||||
,(u'Zivot i stil' , u'http://www.politika.rs/rubrike/zivot-i-stil/index.1.lt.xml' )
|
||||
]
|
||||
|
76
src/calibre/web/feeds/recipes/vreme.py
Normal file
76
src/calibre/web/feeds/recipes/vreme.py
Normal file
@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
|
||||
'''
|
||||
vreme.com
|
||||
'''
|
||||
|
||||
import string
|
||||
import locale
|
||||
from calibre import strftime
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
class Vreme(BasicNewsRecipe):
|
||||
|
||||
title = 'Vreme'
|
||||
__author__ = 'Darko Miletic'
|
||||
description = 'Politicki Nedeljnik Srbije'
|
||||
timefmt = ' [%A, %d %B, %Y]'
|
||||
no_stylesheets = True
|
||||
simultaneous_downloads = 1
|
||||
delay = 1
|
||||
needs_subscription = True
|
||||
INDEX = 'http://www.vreme.com'
|
||||
LOGIN = 'http://www.vreme.com/account/index.php'
|
||||
#Locale setting to get appropriate date/month values in Serbian if possible
|
||||
try:
|
||||
#Windows seting for locale
|
||||
locale.setlocale(locale.LC_TIME,'Serbian (Latin)')
|
||||
except locale.Error:
|
||||
#Linux setting for locale -- choose one appropriate for your distribution
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_YU')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_CS@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr@Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_Latn')
|
||||
except locale.Error:
|
||||
try:
|
||||
locale.setlocale(locale.LC_TIME,'sr_RS')
|
||||
except locale.Error:
|
||||
locale.setlocale(locale.LC_TIME,'C')
|
||||
|
||||
def get_browser(self):
|
||||
br = BasicNewsRecipe.get_browser()
|
||||
if self.username is not None and self.password is not None:
|
||||
br.open(self.LOGIN)
|
||||
br.select_form(name='f')
|
||||
br['username'] = self.username
|
||||
br['password'] = self.password
|
||||
br.submit()
|
||||
return br
|
||||
|
||||
def parse_index(self):
|
||||
articles = []
|
||||
soup = self.index_to_soup(self.INDEX)
|
||||
|
||||
for item in soup.findAll('span', attrs={'class':'toc2'}):
|
||||
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 = ''
|
||||
articles.append({
|
||||
'title':title,
|
||||
'date':date,
|
||||
'url':url,
|
||||
'description':description
|
||||
})
|
||||
return [(soup.head.title.string, articles)]
|
Loading…
x
Reference in New Issue
Block a user