View Single Post
Old 12-18-2010, 02:38 PM   #1
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
Trying to remove gallery pages

This is patterned after an article I read somewhere with respects to getting rid of pages with video in the title or url. It had something to do with the NY Times I think. I am trying on this one to get rid of gallery with no luck. Also if I wanted to do the same with "video" would I have to write another one of these or can they be combined.
Thanks

Spoiler:
def parse_feeds (self):
feeds = BasicNewsRecipe.parse_feeds(self)
for feed in feeds:
for article in feed.articles[:]:
print 'article.title is: ', article.title
if 'Gallery:' in article.title.upper() or 'gallery:' in article.url:
feed.articles.remove(article)
return feeds
mufc is offline   Reply With Quote