View Single Post
Old 02-26-2011, 01:44 PM   #1
ChappyOnIce
Junior Member
ChappyOnIce began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Buffalo News Recipe

I did a recipe for the Buffalo News. The feeds are fairly comprehensive, but they are my personal choices so if anyone would like to use this, he/she should look over the feeds. This is my first one and I started by doing a basic news source, added the feeds, then jumped over to the advanced area and tweaked it until it came out acceptable. I'm a newb to this, so please feel free to make suggestions on how it might be better. My Calibre is set up default output of MOBI for my Kindle 3.

Code:
__license__   = 'GPL v3'
__author__    = 'Todd Chapman'
__copyright__ = 'Todd Chapman'
__version__     = 'v0.1'
__date__        = '26 February 2011'

'''
http://www.buffalonews.com/RSS/
'''

class AdvancedUserRecipe1298680852(BasicNewsRecipe):
    title          = u'Buffalo News'
    oldest_article = 2
    max_articles_per_feed = 20
    encoding = 'utf-8'
    remove_javascript = True
    keep_only_tags    = [
                       dict(name='div', attrs={'class':['main-content-left']})
                        ]

    remove_tags = [
                       dict(name='div', attrs={'id':['commentCount']}),
	   dict(name='div', attrs={'class':['story-list-links']})
                        ]

    remove_tags_after  = dict(name='div', attrs={'class':['body storyContent']})
    conversion_options = {
      'base_font_size'   : 14,
    }
    feeds          = [(u'City of Buffalo', u'http://www.buffalonews.com/city/communities/buffalo/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Southern Erie County', u'http://www.buffalonews.com/city/communities/southern-erie/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Eastern Erie County', u'http://www.buffalonews.com/city/communities/eastern-erie/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Southern Tier', u'http://www.buffalonews.com/city/communities/southern-tier/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Niagara County', u'http://www.buffalonews.com/city/communities/niagara-county/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Business', u'http://www.buffalonews.com/business/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'MoneySmart', u'http://www.buffalonews.com/business/moneysmart/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Bills & NFL', u'http://www.buffalonews.com/sports/bills-nfl/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Sabres & NHL', u'http://www.buffalonews.com/sports/sabres-nhl/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Bob DiCesare', u'http://www.buffalonews.com/sports/columns/bob-dicesare/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Bucky Gleason', u'http://www.buffalonews.com/sports/columns/bucky-gleason/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Mark Gaughan', u'http://www.buffalonews.com/sports/bills-nfl/inside-the-nfl/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Mike Harrington', u'http://www.buffalonews.com/sports/columns/mike-harrington/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Jerry Sullivan', u'http://www.buffalonews.com/sports/columns/jerry-sullivan/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Other Sports Columns', u'http://www.buffalonews.com/sports/columns/other-sports-columns/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Life', u'http://www.buffalonews.com/life/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Bruce Andriatch', u'http://www.buffalonews.com/city/columns/bruce-andriatch/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Donn Esmonde', u'http://www.buffalonews.com/city/columns/donn-esmonde/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Rod Watson', u'http://www.buffalonews.com/city/columns/rod-watson/?widget=rssfeed&view=feed&contentId=77944'),
	     (u'Entertainment', u'http://www.buffalonews.com/entertainment/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Off Main Street', u'http://www.buffalonews.com/city/columns/off-main-street/?widget=rssfeed&view=feed&contentId=77944'), 
	     (u'Editorials', u'http://www.buffalonews.com/editorial-page/buffalo-news-editorials/?widget=rssfeed&view=feed&contentId=77944')
	     ]
I have this set up to auto download at 8am daily. I've noticed that the Buffalo News is still posting to their RSS feeds as late as 7:30am.

Thanks,
Todd

Last edited by ChappyOnIce; 02-26-2011 at 01:51 PM. Reason: Added author and version info
ChappyOnIce is offline   Reply With Quote