×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    How to display same RSS feed in widget application?

    Hi


    I tried to display following RSS Feed in widget application:

    http://rss.news.yahoo.com/rss/topstories
    http://news.google.com/news?ned=in&h...c=s&output=rss

    but i am able to display feed without any Images.
    If I want to display all detail same as RSS feed (with Images) than what can i do?
    Please help me.

    Regards,
    SymbianTH

  2. #2
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to display same RSS feed in widget application?

    Hi SymbianTH,

    to display images, you should retrieve the image sources (e.g.: from the <media:content> tag for the Yahoo! feed) and them dinamically load these as explained in this Forum Nokia Wiki article:

    http://wiki.forum.nokia.com/index.ph...on_WRT_Widgets

    Hope it helps,
    Pit

  3. #3
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to display same RSS feed in widget application?

    Hi

    I am beginner in Widgets.

    I am making simple RSS widget from Aptana Studio, which is display RSS News Reader.

    Is it possible to display more content in Rss Feed, In mobile screen News displayed with title, and one line content. Is it possible to increase displayed content lines/details?

    So i think it's possible to display image with all News Titles. because every Rss Feed's images have image address.

    Regards,
    SymbianTH

  4. #4
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to display same RSS feed in widget application?

    Following code I got from Internet. I want to display this way so please help me.

    Copy Paste this code in .html page between <body> ... <body> tag.
    if param_blurbLength: 500 than do not display image
    if param_blurbLength: more 800 than display image.
    Code:
    <script type="text/javascript" src="http://downloads.thespringbox.com/web/swfobject_2.js"></script>
    	<div id="springwidgets_23" align="center" style="width:250px; height:336px; text-align:center;">
    
    	</div>
    	
    	<script type="text/javascript">
    		var flashVars = 
    		{
    			param_param:'http%3A%2F%2Frss.news.yahoo.com%2Frss%2Ftopstories', 
    			param_style_borderColor:'0x000000', 
    			param_compactView:'false', 
    			param_blurbLength:'1000'
    		};
    		var params= 
    		{
    			wmode:'transparent', 
    			quality:'high', 
    			allownetworking:'all', 
    			allowscriptaccess:'always', 
    			allowfullscreen:'true', 
    			bgcolor:'0x000000'
    		};
    		swfobject.embedSWF('http://downloads.thespringbox.com/web/wrapper.php?file=RSS Reader.sbw', 'springwidgets_23', '250', '336', '8.0.0', 'http://downloads.thespringbox.com/web/expressInstall.swf', flashVars, params);
    	</script>
    Regards,
    SymbianTH

  5. #5
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to display same RSS feed in widget application?

    Quote Originally Posted by jappit View Post
    Hi SymbianTH,

    to display images, you should retrieve the image sources (e.g.: from the <media:content> tag for the Yahoo! feed) and them dinamically load these as explained in this Forum Nokia Wiki article:

    http://wiki.forum.nokia.com/index.ph...on_WRT_Widgets

    Hope it helps,
    Pit
    Hi

    Sorry for following post. you are right. I got it now what you said.

    Thanks
    SymbianTH

  6. #6
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to display same RSS feed in widget application?

    i wrote this way in RSSReader.js file but do not load image. where is the problem in loading image please tell me.

    Code:
    var imgCamNum = 0;
    function getContentHTMLForFeedItem(item) 
    {
        var buf = "";
    if (item.imageurl != null)
    {
    imgCamNum = imgCamNum + 1;
    		buf += "<div class=\"FeedItemImageURL\">" + item.imageurl + "<img id = \"imgCam_" + imgCamNum + "\" /></div>";
    loadImage(item.imageurl,imgCamNum);
    }
     return buf;
    }
    
    function loadImage(aLink, imgCamNum)
    {
    	var _imgCam = document.getElementById('imgCam_' + imgCamNum);
    	_imgCam.src = aLink;
    }
    Regards,
    SymbianTH

  7. #7
    Nokia Developer Champion
    Join Date
    Nov 2007
    Location
    Rome, Italy
    Posts
    2,406

    Re: How to display same RSS feed in widget application?

    From your code it seems that you're trying to access the image DOM elements (via the document.getElementById('imgCam_' + imgCamNum) call) before actually adding them to your page. Infact, you call the loadImage() function before the HTML contained in the buf variable is actually returned, and so added (guessing, since this code is missing) to your HTML page.

    Pit

  8. #8
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Re: How to display same RSS feed in widget application?

    Hi

    Now I solved this problem

    Solution:
    RSSReader.js
    Code:
    function getContentHTMLForFeedItem(item) {
        var buf = "";
    	// item image URL
    	if (item.imageurl != null){
    		imgCamNum = imgCamNum + 1;
    		buf += "<div class=\"FeedItemImageURL\">" + item.imageurl + "<img id = \"imgCam_" + imgCamNum + "\" /></div>";
    	}
    
        return buf;
    }
    
    function loadImage(aLink, imgCamNum){
    	var _imgCam = document.getElementById('imgCam_' + imgCamNum);
    	_imgCam.src = aLink;
    }
    
    // Sets feed items.
    function setFeedItems(items) {
       
        removeFeedItems();
           
        for (var i = 0; i < items.length; i++) {
          
            var feedItemControl;
            if (i == feedItemControlPool.length) {
                feedItemControl = new ContentPanel(null, null, null, true);
                feedItemControlPool.push(feedItemControl);
            } else {
                feedItemControl = feedItemControlPool[i];
            }
            
            // initialize feed item control
            var item = items[i];
            feedItemControl.setCaption(item.title);
            feedItemControl.setContent(getContentHTMLForFeedItem(item));
            feedItemControl.setExpanded(false);
            
            // add the feed item control to the main view
            feedItemControls.push(feedItemControl);
            mainView.addControl(feedItemControl);
    		
    	loadImage(item.imageurl,imgCamNum);
        }
    }

Similar Threads

  1. Replies: 6
    Last Post: 2009-05-23, 17:59
  2. Recording in Amr Format
    By losym in forum Symbian Media (Closed)
    Replies: 12
    Last Post: 2009-03-26, 06:41
  3. Is it Possible display application size
    By pavan in forum Symbian
    Replies: 3
    Last Post: 2008-11-10, 21:02
  4. Replies: 0
    Last Post: 2005-03-14, 04:07

Posting Permissions

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