View Single Post
Old 02-27-2010, 10:21 AM   #1501
Costaz
Junior Member
Costaz began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by p4np5n View Post
Ok, I managed to find out what's wrong with the above. I would therefore like to submit (the first) two greek recipes for calibre!

Kathimerini
Spoiler:
from calibre.web.feeds.recipes import BasicNewsRecipe

class Kathimerini(BasicNewsRecipe):
title = 'Kathimerini'
__author__ = 'Pan'
description = 'News from Greece'
max_articles_per_feed = 100
oldest_article = 100
publisher = 'Kathimerini'
category = 'news, GR'
language = 'el'
no_stylesheets = True
remove_tags_before = dict(name='td',attrs={'class':'news'})
remove_tags_after = dict(name='td',attrs={'class':'news'})
remove_attributes = ['width', 'src','header','footer']

feeds = [
('Πολιτική', 'http://wk.kathimerini.gr/xml_files/politics.xml'),
('Ελλάδα', ' http://wk.kathimerini.gr/xml_files/ell.xml'),
('Κόσμος', ' http://wk.kathimerini.gr/xml_files/world.xml'),
('Οικονομία', 'http://wk.kathimerini.gr/xml_files/economy_1.xml'),
('Επιχειρήσεις', 'http://wk.kathimerini.gr/xml_files/economy_2.xml'),
('Διεθνής Οικονομία', 'http://wk.kathimerini.gr/xml_files/economy_3.xml'),
('Πολιτισμός', 'http://wk.kathimerini.gr/xml_files/civ.xml'),
('Μόνιμες Στήλες', 'http://wk.kathimerini.gr/xml_files/st.xml'),
]

def print_version(self, url):
return url.replace('http://news.kathimerini.gr/4dcgi/', 'http://news.kathimerini.gr/4dcgi/4dcgi/')


and Ta Nea
Spoiler:
class TaNea(BasicNewsRecipe):
title = u'Ta Nea'
__author__ = 'Pan'
oldest_article = 1
max_articles_per_feed = 100
no_stylesheets = True

remove_tags_before = dict(name='div',attrs={'id':'print-body'})
remove_tags_after = dict(name='div',attrs={'id':'text'})
feeds = [
(u'Ελλάδα', u'http://www.tanea.gr/default.asp?pid=66&la=1'),
(u'Κόσμος', u'http://www.tanea.gr/default.asp?pid=67&la=1'),
(u'Οικονομία', u'http://www.tanea.gr/default.asp?pid=68&la=1'),
(u'Πολιτισμός', u'http://www.tanea.gr/default.asp?pid=69&la=1'),
(u'Γνώμες', u'http://www.tanea.gr/default.asp?pid=79&la=1'),
(u'Ριπές', u'http://www.tanea.gr/default.asp?pid=80&la=1'),
(u'Αιχμές', u'http://www.tanea.gr/default.asp?pid=81&la=1')
]

def print_version(self, url):
return url.replace('http://www.tanea.gr/default.asp?pid=2', 'http://www.tanea.gr/default.asp?pid=96')
Am I missing something? The above two recipes were supposed to be in 0.6.41, according to the changelog. I am now using 0.6.43 and they don't seem to appear in the Fetch News Dialog . Any ideas?
Costaz is offline