View Single Post
Old 08-06-2014, 05:13 AM   #1
logophile777
Junior Member
logophile777 began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2014
Device: none
print_version for BBC Arabic

I'm still a newbie when it comes to recipes. However, I made a simple recipe for BBC Arabic that worked well with default URLs and auto_cleanup. The only problem was some repetitive text about using Java etc in every article that had a video in it.

I tried to use the print_version feature, but it didn't work; here's what I used:

def print_version(self, url):
return url.replace('.shtml', '.shtml?print=1')

Note: The only difference between the original article url and the print version is that the print version has ".shtml?print=1" instead of ".shtml?" at the end.

Here's the RSS feed:
http://www.bbc.co.uk/arabic/index.xml

Here's a sample original article url:
http://www.bbc.co.uk/arabic/middleea...nterview.shtml

And here's the print version for the same article:
http://www.bbc.co.uk/arabic/middleea....shtml?print=1

Also, I'd like to learn what code to add to delete certain repetitive text, i.e. how to replace it with nothing.

Many thanks
logophile777 is offline   Reply With Quote