×

Discussion Board

Results 1 to 4 of 4

Thread: Images from RSS

  1. #1
    Registered User
    Join Date
    May 2013
    Posts
    5

    Unhappy Images from RSS

    Hello, Im using Nokia Web App Tools.

    I want to create an rss reader app. For this, I started from the sample rss code that came with the software.

    I want to know how to show the images from my posts. This is the piece of code that contains the images in my rss feed:

    Code:
    <content:encoded>
    <![CDATA[
    <p> <img src="http://3.bp.blogspot.com/-WpF57XvFFjU/UQC3Ex99wmI/AAAAAAAAAEw/kTZ764YwS6Q/s1600/Teen%2BSpirit.jpg" alt="ESPIRITU ADOLECENTE peliculas completas en español, peliculas gratis completas, peliculas online subtituladas" title="ESPIRITU ADOLECENTE peliculas completas en español, peliculas gratis completas, peliculas online subtituladas" /> </p><div id=HOTWordsTxt name=HOTWordsTxt><p><strong>Sinopsis:</strong><br /> Amber es una chica popular que muere electrocutada. Sin embargo, Amber no tendrá permitida la entrada en el cielo a no ser que ayude a que la joven con menos popularidad de todo el instituto se convierta en la reina del baile en menos de una semana.</p> <p><strong>Año: </strong>2011<br /> <strong>Género: </strong>Romanticas</p> <p><iframe src="//www.youtube.com/embed/GnhGKzID_s4?rel=" height="360" width="100%" allowfullscreen="" frameborder="0"></iframe></p> </div>
    ]]>
    </content:encoded>
    Does anyone know how to show that image in my RSS project?

    Thanks!

  2. #2
    Registered User
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    280

    Re: Images from RSS

    Should be possible. Is the text of the feed visible?
    Try to use local preview and debugger and
    1) look at console for javascript errors and
    2) look at the generated source (or elements). Is the html-code of the feed item inside it? What does the image like look like? Maybe it is a problem with the %"B in the file name.

    Regards
    Karsten Meier

  3. #3
    Registered User
    Join Date
    May 2013
    Posts
    5

    Arrow Re: Images from RSS

    Hey Karsten, thanks for your answer.

    What do you mean with "Is the text of the feed visible?"

    Also, I'm already using the Local Preview to test the app, beacuse it does not work using the Cloud Preview (is it normal?)

    This is what I get in the image source code:



    And this is what I have in my rssVerticalView.js file:

    Code:
    outputstr += '<div class="headlinePic inline">';
    		outputstr += "<img width=\"" + ((entries[i].image && entries[i].image.width && parseInt(entries[i].image.width) <= 77)? entries[i].image.width: "50") + 
    		             "\" height=\"" + ((entries[i].image && entries[i].image.height && parseInt(entries[i].image.height) <= 75)? entries[i].image.height: "50") + 
    					 "\" src=\"" + ((entries[i].image && entries[i].image.url)? entries[i].image.url: "s40-theme/images/rss3.png") + "\"/>";
    		outputstr += '</div>';
    Thanks dude!

  4. #4
    Registered User
    Join Date
    Mar 2005
    Location
    Hamburg, Germany
    Posts
    280

    Re: Images from RSS

    Unfortunately not all rss-feeds are the same. Especially when it comes to images. So it looks like you need to adjust the code for your rss-feed.

    First there is parser that analyses your rss-feed and puts in into a jascript-structure.
    Then there is the output function that creates html.

    If you look at the output-function above, where is image is constructed, you see that it put in the url "s40-theme/images/rss3.png" if entries[i] does not has an image.
    (yes the code is not easy to understand with all this mix of html and javascript and quotes. also notice that it uses the "?" instead of an if statement.
    What is the exact template/sample you used? because there are several rss-reading examples. probably this need some code improvement.)

    I think your feed does not set the image element of the entry. If you still want to show images, you need to extract the image src from from item text.
    Then you set the entries[i].image field, and the view code will display your image.

    You will you need the JavaScript debugger, set breakpoint in parsing code, and check how it works and how it interprets your rss feed.

    This kind of debugging you can do only with local preview.
    Unfortunately you also need cloud preview. Because if does not word in cloud preview, it will also not work on the device. But one problem at a time.

    Regards

    Karsten Meier

Similar Threads

  1. problem getting the images from images.google.com..!!!
    By buffon2009 in forum Mobile Java General
    Replies: 1
    Last Post: 2011-01-19, 01:43
  2. Replies: 5
    Last Post: 2009-07-20, 18:41
  3. Replies: 5
    Last Post: 2009-03-09, 08:24
  4. Drawing PNG images against Array Images
    By melas21 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2004-01-19, 21:55
  5. images...
    By marcgom in forum Mobile Java General
    Replies: 0
    Last Post: 2002-09-28, 05:59

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •