View Single Post
Old 03-12-2010, 12:53 PM   #1580
Ekips
Member
Ekips began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Mar 2010
Device: PW2, K3gb(x2), K3w, K4, k5(x3) PRS-505s, Stanza for ipod
I'm trying to make my own recipe for the sun.co.uk but I'm having a few probs

I'm using just one feed at the minute to speed up downloading while testing and I'm trying to fetch just the main article.



The custom recipe I've come up with is

Code:
class AdvancedUserRecipe1268409464(BasicNewsRecipe):
    title          = u'The Sun'
    oldest_article = 3
    max_articles_per_feed = 100
    no_stylesheets = True
    extra_css      = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt  }'

    keep_only_tags    = [ 
                           dict(name='div', attrs={'class':'medium-centered'})
                          ,dict(name='div', attrs={'class':'article'}) 
                        ]
    remove_tags    = [dict(name='div', attrs={'class':'slideshow'})]




    feeds          = [(u'News', u'http://www.thesun.co.uk/sol/homepage/feeds/rss/article312900.ece')]

    def print_version(self, url):
          return url.replace('?OTC-RSS&ATTR=News', '?print=yes')
    def print_version(self, url):
          return url.replace('?OTC-RSS&ATTR=Royals', '?print=yes')
    def print_version(self, url):
          return url.replace('?OTC-RSS&ATTR=Gizmo', '?print=yes')

But this is not fetching anything.

Can anyone give me some pointers please?
Ekips is offline