View Single Post
Old 03-04-2010, 12:42 PM   #1532
rylsfan
Member
rylsfan began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Feb 2010
Device: Kindle2
Hi all. I had posted a recipe to obtain news feeds from the KC Star regarding the Kansas City Royals. Since then, the Star has altered their printable url. I have updated the recipe because I just know how how popular a team that boasts a Cy Young winner while also barely avoiding to lose 100 games can be :-)

class kcStarRoyals(BasicNewsRecipe):
title = u'kcstar-royals'
oldest_article = 5
max_articles_per_feed = 15
language = 'en'
no_stylesheets = True
use_embedded_content = False
remove_javascript = True
encoding= 'ISO-8859-1'

remove_tags_before = dict(name='h1')
remove_tags_after = dict(id='storyBody')

remove_tags = [dict(name=['object','link','script','iframe'])]
# add feeds with first name, then xml/rss
feeds = [(u'KC Star', u'http://www.kansascity.com/sports/royals/index.xml')]

# use the print version
# KC Star adds a v-print in the
# middle of the url so it needs
# to be split
def print_version(self, url):
slashparts = url.split('/')
return '/'.join(slashparts[:3])+'/' +'/'.join(slashparts[3:6])+'/v-print/'+slashparts[6]+'/'+slashparts[7]

Last edited by rylsfan; 03-04-2010 at 12:43 PM. Reason: took out extraneous comments
rylsfan is offline