Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
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
Old 03-02-2011, 03:41 PM   #2
ChappyOnIce
Junior Member
ChappyOnIce began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Updated Buffalo News Recipe

Added indents and masthead logo, some minor tweaks.
Code:
__license__   = 'GPL v3'
__author__    = 'Todd Chapman'
__copyright__ = 'Todd Chapman'
__version__     = 'v0.2'
__date__        = '2 March 2011'

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

class AdvancedUserRecipe1298680852(BasicNewsRecipe):
    title          = u'Buffalo News'
    oldest_article = 2
    max_articles_per_feed = 20
    encoding = 'utf-8'
    masthead_url = 'http://www.buffalonews.com/buffalonews/skins/buffalonews/images/masthead/the_buffalo_news_logo.png'
    remove_javascript = True
    extra_css = 'body {text-align: justify;}\n  \
	   p {text-indent: 20px;}'

    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']})

    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')
	     ]
ChappyOnIce is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buffalo Airways - Diamonds, DC-3s and 'Buffalo Joe' McBryan darrellknight Self-Promotions by Authors and Publishers 5 03-05-2012 07:20 PM
Recipe for KA-News.de tfeld Recipes 0 12-30-2010 05:45 PM
Customise News Recipe goaspy Calibre 5 12-08-2010 03:08 PM
Help with news recipe Acey Calibre 2 03-12-2010 06:36 AM
The Times news recipe? AprilHare Calibre 1 10-10-2008 01:48 PM


All times are GMT -4. The time now is 01:51 PM.


MobileRead.com is a privately owned, operated and funded community.