View Single Post
Old 03-28-2010, 06:49 PM   #1672
gambarini
Connoisseur
gambarini began at the beginning.
 
Posts: 98
Karma: 22
Join Date: Mar 2010
Device: IRiver Story, Ipod Touch, Android SmartPhone
My first recipe

The Apple Lounge an italian apple blog.

Any suggestion?

from calibre.ebooks.BeautifulSoup import BeautifulSoup
from calibre.web.feeds.news import BasicNewsRecipe
class Informatica(BasicNewsRecipe):
title = u'Informatica'
__author__ = 'Gabriele Marini'
oldest_article = 15
max_articles_per_feed = 100
use_embedded_content = False
remove_tags_after = dict(name='div', attrs={'id':'greet_block'})
no_stylesheets = True
feeds = [(u'The Apple Lounge', u'http://feeds.feedburner.com/Theapplelounge?format=xml')]
def print_version(self, url):
raw = self.browser.open(url).read()
soup = BeautifulSoup(raw.decode('utf8', 'replace'))
print_link = soup.find('a', {'title':'Stampa questo articolo'})
if print_link is None:
return url
return print_link['href']
gambarini is offline