View Single Post
Old 03-29-2010, 11:09 AM   #1677
olaf
Enthusiast
olaf is on a distinguished road
 
Posts: 43
Karma: 50
Join Date: May 2009
Device: Kindle3
Quote:
Originally Posted by kiklop74 View Post
Your recipe is too complicated. This is simplified and cleaned-up version (add more feeds, this is just example):

Code:
class Telegram(BasicNewsRecipe):
    title                 = 'Telegram'
    oldest_article        = 2
    max_articles_per_feed = 100
    no_stylesheets        = False
    use_embedded_content  = False
    encoding              = 'cp1252'
    publication_type      = 'newspaper'
    remove_empty_feeds    = True
    extra_css             = ' body{font-family: Verdana,sans-serif} .headline{font-size: xx-large; font-weight: bold} .mainPhotoCaption{font-size: x-small} '

    keep_only_tags     = [dict(name='div', attrs={'id':'articleWell'})]
    remove_tags_before = dict(attrs={'class':'headline'})
    remove_tags_after  = dict(attrs={'id':'zoom1'})
    remove_tags = [
                     dict(name='div', attrs={'class':'relatedContent'})
                    ,dict(name=['object','link','iframe'])
                  ]

    feeds          = [ 
                        (u'Front page' , u'http://www.telegram.com/apps/pbcs.dll/section?Category=RSS03&MIME=xml')
                     ]

    def preprocess_html(self, soup):
        return self.adeify_images(soup)

Kiklop - that did the trick - thank you!
olaf is offline