View Single Post
Old 12-21-2010, 11:48 PM   #6
mufc
Connoisseur
mufc doesn't littermufc doesn't litter
 
Posts: 99
Karma: 170
Join Date: Nov 2010
Location: Airdrie Alberta
Device: Sony 650
Missing Something

When I do this I get rid of articles with Video in the title but Gallery is ignored in the url when it clearly is in the url. Not only that but when I tried removing .upper in line 5 it would not work even though Video in my titles only has first letter Upper Case. On trying to delete pages with Gallery in the title I added another instance of the def parse feed but reversed where VIDEO and GALLERY are in the recipe and then I got rid of Gallery pages but not Video pages. Seems the 2nd instance overrode the first. Is there any way to combine both VIDEO and GALLERY in one.
Hope I made myself clear. It seems that the first part works fine for me but not the second.
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 'VIDEO' in article.title.upper() or 'GALLERY' in article.url:
feed.articles.remove(article)
return feeds
mufc is offline   Reply With Quote