Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
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
Old 12-18-2010, 04:02 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by mufc View Post
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.
See here.

You need to make GALLERY all caps if you're going to test on upper case, and I don't think the colon will be in your url, so remove that.

You can add the VIDEO test in, too.

Last edited by Starson17; 12-18-2010 at 04:05 PM.
Starson17 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic Split PDF pages into smaller pages (images into tiles) Astro Barnes & Noble NOOK 4 06-12-2020 10:56 AM
New hack PRS-505: multi status line with %read, time&pages reading, pages per minute. Car105 Sony Reader Dev Corner 5 01-03-2010 10:03 AM
Turning Scanned PDFs with facing pages into single pages jimteacher Workshop 5 11-09-2009 02:59 PM
RFE: Remove remove tags in bulk edit magphil Calibre 0 08-11-2009 10:37 AM


All times are GMT -4. The time now is 09:27 AM.


MobileRead.com is a privately owned, operated and funded community.