View Single Post
Old 05-30-2009, 05:52 PM   #5
kiklop74
Guru
kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.kiklop74 can program the VCR without an owner's manual.
 
kiklop74's Avatar
 
Posts: 800
Karma: 194644
Join Date: Dec 2007
Location: Argentina
Device: Kindle Voyage
I would recommend you to use in this case method get_article_url instead of print_version. In get_article_url you have access to the xml and you can override all article entries with print version:

Code:
    def get_article_url(self, article):
        raw_url = article.get('link',  None)
        date_url = article.get('pubDate',  None)
        #Extract values from date_url
        #we assume you have the final version of date string in datestr variable
        datestr = "<processed valid value>"
        art_id = raw_url.rsplit('/article_')[1]
        nurl = raw_url.replace('http://www.somewebsite.com/','http://www.somewebsite.com/print/' + datestr + '/' + art_id)
        return nurl
With such code you do not need print_version at all

Examples of this you can see at various recipes like La prensa, NIN etc.
kiklop74 is offline   Reply With Quote