View Single Post
Old 02-12-2011, 01:54 PM   #1
Tegan
Connoisseur
Tegan began at the beginning.
 
Posts: 59
Karma: 10
Join Date: Jan 2011
Device: Kindle 1st Gen, Kindle 3 SO
New Recipe - Wyoming Tribune Eagle Online

Just made this for another person I've been helping out with Calibre, thought it might be useful for other folks.

Code:
class WyomingTribuneEagle(BasicNewsRecipe):
    title          = u'Wyoming Tribune Eagle Online'
    description    = 'Headquartered in Cheyenne, the Wyoming Tribune-Eagle is the second-largest daily newspaper in Wyoming and its largest locally owned newspaper.'
    __author__     = 'Laura Gjovaag'
    oldest_article = 7
    max_articles_per_feed = 100
    remove_javascript   = True
    no_stylesheets      = True
    remove_empty_feeds  = True

    feeds          = [
                      (u'Local News', u'http://www.wyomingnews.com/?rss=news'), 
                      (u'Sports', u'http://www.wyomingnews.com/?rss=sports'), 
                      (u'Entertainment', u'http://www.wyomingnews.com/?rss=entertainment'), 
                      (u'Outdoors', u'http://www.wyomingnews.com/?rss=outdoors'), 
                      (u'Editorial', u'http://www.wyomingnews.com/?rss=opinion/staff_editorials'), 
                      (u'Editor', u'http://www.wyomingnews.com/?rss=opinion/editors_column'), 
                      (u'Letters', u'http://www.wyomingnews.com/?rss=opinion/featured_letter'), 
                      (u'Obits', u'http://www.wyomingnews.com/?rss=obituaries'),
                      ]

    def print_version(self, url):
        return url.replace('.txt', '.prt')

    keep_only_tags  = [
                      dict(name='span', attrs={'class':['timestamp']}),
                      dict(name=['h2', 'p']),
                      ]
Tegan is offline   Reply With Quote