Thread: iDnes.cz news
View Single Post
Old 09-25-2010, 01:40 PM   #2
TonytheBookworm
Addict
TonytheBookworm is on a distinguished road
 
TonytheBookworm's Avatar
 
Posts: 264
Karma: 62
Join Date: May 2010
Device: kindle 2, kindle 3, Kindle fire
Quote:
Originally Posted by ramesses View Post
Hi,
I was trying to do a recipe for iDnes.cz news (RSS: http://servis.idnes.cz/rss.asp?c=zpravodaj) but I stuck with print_version.
I didn't find any similiar rss source to this one. I would appriciate help with converting article url.

example article url:
http://zpravy.idnes.cz/pojd-s-nami-k...1427_krimi_zep

its coresponding printable version url:
http://zpravy.idnes.cz/tiskni.asp?c=...1427_krimi_zep

Thank you for any little help.
post your code here and i will try to help you out. take and wrap it in spoiler tags and code tags. change the " to a [
example:
"spoiler"
"code'
paste your recipe code here
"/code"
"/spoiler"

here is a general idea of how to convert the print_version

You state the original url is:
and the printversion is:
So what the only thing you need from the original url is everything after the ? mark
In that case you simply can split the url at the ? and then it will be in two parts
u'http://xxxxxxxxxxxxxxxxxxxxxx' u'c=A100925_171427_krimi_zep'

the split will be 0 based so we want the index of 1
see below:

Code:
def print_version(self, url):
        split_url = url.split("?")
        print_url = 'http://zpravy.idnes.cz/tiskni.asp? ' +  split_url[1] '
        return print_url

Last edited by TonytheBookworm; 09-25-2010 at 01:53 PM. Reason: added example
TonytheBookworm is offline   Reply With Quote