View Single Post
Old 08-10-2011, 04:29 PM   #3
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 bosplans View Post
I am preparing a new recipe for voxeu.org, an Europeany policy porta.
The recipe so far work properly apart the images in articles fetched are not displayed in the output. Looks like the recipe get the wrong link to the original image (it is a relative link).
Any workaround to fix the problem?

Here the recipe source:

Spoiler:
Code:
class Vox(BasicNewsRecipe):
    __author__        = 'Voxeu.org'
    description   = 'Policy portal set up by the Centre for Economic Policy Research'

    cover_url      = 'http://farm7.static.flickr.com/6122/6030018218_2a48a07230_z.jpg'
    title          = u'Vox'
    category       = 'Policy, politics, culture, economy, financial, Italian'

    language       = 'en'
    timefmt        = '[%a, %d %b, %Y]'

    oldest_article = 7
    max_articles_per_feed = 100
    use_embedded_content  = False
    recursion             = 10
    extra_css      = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt  }'

         
    remove_tags = [
                            dict(name='fieldset', attrs={'class':['fieldgroup group-authors','fieldgroup group-editors-choice']}),
                            dict(name='div', attrs={'class':['print-taxonomy','print-footer','print-source_url','print-links']}),
                           ]

    feeds = [
                  (u'Notizie', u'http://www.voxeu.org/rss.php?q=recent'),
                ]

    def print_version(self, url):
          return url.replace('node', 'print')

Thanks!
If it's a relative link, then just replace the relative link with a full link by modifying the link. There are lots of recipes that do that. Try looking at the adventuregamers recipe. It does it like this when dealing with a relative link:

INDEX = u'http://www.adventuregamers.com'
nexturl = self.INDEX + pager.a['href']
Starson17 is offline   Reply With Quote