View Single Post
Old 12-15-2009, 11:54 PM   #965
cr4zyd
Junior Member
cr4zyd began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Dec 2009
Device: Kindle 2
I had no idea it was that easy to create recipes! After an hour of reading the API and a few other recipes I successfully created one for the Clarion Ledger! Thanks lots for this AMAZING program and the really neat features that comes with it.

And now for the code, please let me know if you see anything that shouldnt be there. Otherwise, enjoy fellow Mississippians.

Code:
class AdvancedUserRecipe1260934776(BasicNewsRecipe):
    title          = u'Clarion Ledger'
    oldest_article = 7
    max_articles_per_feed = 100
    no_stylesheets        = True

    feeds          = [(u'Local News', u'http://www.clarionledger.com/apps/pbcs.dll/oversikt?Category=RSS01'), (u'Breaking News', u'http://www.clarionledger.com/apps/pbcs.dll/section?Category=RSS'), (u'Sports', u'http://www.clarionledger.com/apps/pbcs.dll/oversikt?Category=RSS02'), (u'Business', u'http://www.clarionledger.com/apps/pbcs.dll/oversikt?Category=RSS03')]

    keep_only_tags = [dict(name='div', attrs={'class':'article-headline'}),
     dict(name='div', attrs={'class':'article-bodytext'})]
    remove_tags = [dict(name=['img','script','li']),
     dict(name='p', attrs={'class':'ratingbyline'}),
     dict(name='div', attrs={'class':'article-tools'}),
     dict(name='div', attrs={'class':'article-pagination article-pagination-top'}),
     dict(name='div', attrs={'class':'article-pagination article-pagination-bottom'}),
     dict(name='div', attrs={'class':'articleflex-container'})]

Last edited by cr4zyd; 12-15-2009 at 11:56 PM.
cr4zyd is offline