View Single Post
Old 11-02-2010, 01:30 PM   #16
orcpac7
Junior Member
orcpac7 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jun 2010
Device: cailbre
Couldn't find the thread where Starson17 posted the original Fudzilla script so just tagging this on to a thread I found his comment on.
Fudzilla at some point changed the URL of their feed. It was a gentle introduction to the recipes for me when i wanted to change that. Ended up saving the code in a text file, modifying the code, delete the old recipe and import the new one from file.
The only line I changed was the feeds to point to "http://www.fudzilla.com/?format=feed'"
Quote:
#!/usr/bin/env python

__license__ = 'GPL v3'
__copyright__ = '2010 Starson17'
'''
fudzilla.com
'''

import re
from calibre.web.feeds.news import BasicNewsRecipe

class Fudzilla(BasicNewsRecipe):
title = u'Fudzilla'
__author__ = 'Starson17'
language = 'en'

description = 'Tech news'
oldest_article = 7
remove_javascript = True
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False


remove_tags_before = dict(name='div', attrs={'class':['padding']})

remove_tags = [dict(name='td', attrs={'class':['left','right']}),
dict(name='div', attrs={'id':['toolbar','buttons']}),
dict(name='div', attrs={'class':['artbannersxtd','back_button']}),
dict(name='span', attrs={'class':['pathway']}),
dict(name='th', attrs={'class':['pagenav_next','pagenav_prev']}),
dict(name='table', attrs={'class':['headlines']}),
]

feeds = [
(u'Posts', u'http://www.fudzilla.com/?format=feed')
]

preprocess_regexps = [
(re.compile(r'<p class="MsoNormal"> Welcome.*</p> ', re.DOTALL|re.IGNORECASE), lambda match: '')
]
orcpac7 is offline   Reply With Quote