View Single Post
Old 02-22-2011, 02:20 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 slex View Post
This is the full article:

http://www.investor.bg/news/article/112881/332.html

And this is the print version:

http://www.investor.bg/news/printer/112881/332.html

From the recipe guide it looks like I should copy the BBC example for the print version and I add to the recipe the following:

Code:
def print_version(self, url):
        return url.replace('http://www.investor.bg/news/article/', 'http://www.investor.bg/news/printer/')
But I still get the full version, not the print version.

Can anyone give an advice?
I looked at this feed:
http://rss.investor.bg/c/33288/f/564906/index.rss
That feed does not give a url in the form of
http://www.investor.bg/news/article/112881/332.html like you are expecting.

It looks like this:
http://rss.investor.bg/c/33288/f/564...ml/story01.htm
In the future, you might want to post the full recipe. I had to guess about where your feed was, so if I guessed wrong, try this:
Code:
    def print_version(self, url):
        newurl = url.replace('http://www.investor.bg/news/article/', 'http://www.investor.bg/news/printer/')
        print 'The original url is: ', url
        print 'The new url is: ', newurl
        return newurl
Then look at the output to make sure your links are being created correctly.
Starson17 is offline   Reply With Quote