View Single Post
Old 08-14-2010, 01:24 PM   #2443
soothsayer
Member
soothsayer began at the beginning.
 
Posts: 13
Karma: 34
Join Date: Jul 2010
Device: hanlin, astak the 2010 version plz.
making a custom recipe for the NY Daily News, basic recipe, but first time using python and I need some help formatting.

here is waht I have now.

-------------------------------------------------------------------


Code:
class AdvancedUserRecipe1281804307(BasicNewsRecipe):
    title          = u'NY Daily News'
    __author__ = 'you'

    description           = 'News from NY Daily News'
    language              = 'en'
    publisher             = 'NY Daily News'
    category              = 'news, politics, sports, ny'
    oldest_article        = 7
    max_articles_per_feed = 100
    no_stylesheets        = True
    cover_url             = 
    encoding              = 'utf-8'

    oldest_article = 7
    max_articles_per_feed = 100

    no_stylesheets = True
    keep_only_tags    = [
                       dict(name='div', attrs={'id':['art_story']})
                        ]
    remove_tags = [
                       dict(name='div', attrs={'class':['code_module']})
                  ]
    feeds = [(u'Top Stories', u'http://www.nydailynews.com/index_rss.xml'), 
             (u'News', u'http://www.nydailynews.com/news/index_rss.xml'),
             (u'NY Crime', u'http://www.nydailynews.com/news/ny_crime/index_rss.xml'), 
			 (u'NY Local', u'http://www.nydailynews.com/ny_local/index_rss.xml'),
			 (u'Politics', u'http://www.nydailynews.com/news/politics/index_rss.xml'),
			 (u'Music', u'http://www.nydailynews.com/entertainment/music/index_rss.xml'),
             (u'Arts', u'http://www.nydailynews.com/entertainment/arts/index_rss.xml'),
			 (u'Food and Dining', u'http://www.nydailynews.com/lifestyle/food/index_rss.xml'),
			 (u'Lifestyle', u'http://www.nydailynews.com/lifestyle/index_rss.xml'),
			 (u'Health/Well Being', u'http://www.nydailynews.com/lifestyle/health/index_rss.xml'),
			 (u'Sports', u'http://www.nydailynews.com/sports/index_rss.xml'),
             ]


-------------------------------------------

as you can see, "cover_url" is blank, i'm not sure how to format the variables because the url for it will change depending on the date, and it's my first time using python.

here is the basic format for the ny daily news cover page.
http://assets.nydailynews.com/img/20...tpage_0814.jpg

can somebody show me an example template on how to do this?


thanks.
i've another question, in the feeds section, what's that "u" for that just in front of the title and url? i.e., (u'NY Crime', u'http://www.nydailynews.com/news/ny_crime/index_rss.xml'),


btw, i couldn't find the custom recipe for the ny daily news here in this forum.

here are all teh feeds from the ny daily news
http://www.nydailynews.com/services/...ols/index.html

Last edited by soothsayer; 08-14-2010 at 02:35 PM. Reason: fixing indentation
soothsayer is offline