Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Unable to fetch RSS feeds

    Hi All,

    I am trying to use RSS feeds to show latest news. Initially i tried to fetch RSS using contentURL of HTMLPane but it throws an error to use XJSONDataSource (refer attached screen shot). Then i have used XJSONDataSource but it is unable to fetch live data; however if i save the data in an XML and if i use RestDataSource then it display the data. Below is my code:
    Code:
    isc.XJSONDataSource.create({
    ID:"newsRSSFeedsDS",
    dataFormat : "json",
    showPrompt:false,
    dataTransport : "scriptInclude",
    //dataURL:"http://rss.slashdot.org/Slashdot/slashdot",
    dataURL:"http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/bbcrss.xml",
    //dataURL:"../bbcrss.xml",
    /*transformResponse: function (dsResponse, dsRequest, data){
    	eval(data);
    },
    */
    recordXPath: "//item",
    fields: [
            { name: "title" },
            { name: "link", type: "link" }
        ]
    
    });
    
    
    isc.ListGrid.create({
        ID: "newsViewer",
    	width: "100%",
        height:"300",
    	dataSource:"newsRSSFeedsDS",
    	autoFetchData: true,
    	autoDraw:false,
    	showHeader:false,
    		fields: [
            { name: "title" },
            { name: "link", type: "link" }
        ]
    });
    I have also tried by setting dataFormat as 'xml' but it is not working.

    Please guide me to correct solution.

    Thanks,
    Mahesh
    Attached Files

    #2
    Take a look at this tutorial: News Reader. It details a way around the cross-site limitation.

    Comment


      #3
      Thanks so much. Very well explanation, it is working great.

      Thanks again
      Mahesh.

      Comment


        #4
        Hi,

        I have tried the code suggested by davidj6. Thanks to him again. Things are working pretty fine...but I am getting "too much recursion" error on FireFox and IE is crashing.
        Error is:
        Code:
        [Break on this error] "too much recursion",
        isc.A.$fv=function(_1){var _2;if(_1==nu...1.getID():_1.getClassName());return _2}
        ISC_Core.js (line 776)
        Below is my code:
        Code:
        isc.XJSONDataSource.create({
        ID:"newsFeed",
        showPrompt:false,
        recordXPath: "/query/results/item",
        
        dataURL:'http://query.yahooapis.com/v1/public/yql?q=select%20title%2CpubDate%2Clink%2Cdescription%20from%20rss(0%2C6)%20where%20%20%20url%3D%22http%3A%2F%2Fin.biz.yahoo.com%2Fbusiness-news%2Frss%2Findia-business-rss.xml%22&format=json',
        fields:[
        { name: "title",primaryKey:true  },
        { name: "pubDate" },
        { name: "link" },
        { name: "description" }
        ]
        });
        Please correct me.

        Thanks,
        Mahesh

        Comment


          #5
          Please suggest any help.

          Comment

          Working...
          X