I've noticed the link for the print version is the same as the standard with "print-" sandwiched in after the last slash. I thought i might try that instead....
I did some trawling and found starsons thread regarding the join/split by slash method. It seems ideal as i counted the slashs and there were 6, only the string to be inserted changed.
The two links end as...
Cornish-campsite/_ch3_nw1433
Cornish-campsite/Print-_ch3_nw1433
So I thought it was just a case of adding code after the feeds=[] command such as
def print_version(self,url):
segments = URL.split('/')
printURL = '/'.join(segments[0:6]) + '/Print-' + ''.join(segments[6:])
return printURL
I thought this took the url, split it,added '/Print-' and then added the end of the url back on.
it appears to do nothing and the original feeds are still fetched. I've obviously mis-understood how this works.
Can anyone help?
Also is it possible to echo a string to screen so you can test what's going on?
EDit.
I just used the bbc print_version example pasted in after the feeds
ie:
def print_version(self, url):
return url.replace('http://', 'http://newsvote.bbc.co.uk/mpapps/pagetools/print/')
in my reasoning this should have failed as each article would be for example
http://newsvote.bbc.co.uk/mpapps/pag...te/_ch3_nw1433
which wouldn't exist - but the origianl article is still fetched.
I'm baffled now - any help?
thanks guys