0

I am trying to implement the Google Feed API to access an ATOM feed from a server and then display the data on a mobile web app. I get the error "The port specified in the feed URL is not supported." Any thoughts or suggestions?

   // Google Feed API
//Our callback function, for when a feed is loaded.
function feedLoaded(result) {
  if (!result.error) {
      console.log("no error in loading feed");
    // Grab the container we will put the results into
    var container = document.getElementById("page_contents");
    container.innerHTML = '';

    // Loop through the feeds, putting the titles onto the page.
    // Check out the result object for a list of properties returned in each entry.
    // http://code.google.com/apis/ajaxfeeds/documentation/reference.html#JSON
    for (var i = 0; i < result.feed.entries.length; i++) {
      var entry = result.feed.entries[i];
      var div = document.createElement("div");
      div.appendChild(document.createTextNode(entry.content));
      container.appendChild(div);
    }

    console.log(result.feed.entries.length);
  } else {
      var container = document.getElementById("page_contents");
      container.innerHTML = '';

      var div = document.createElement("div");
      div.appendChild(document.createTextNode(result.error.message));
      container.appendChild(div);

      alert(result.error.message);

  }
}

function OnLoad() {
  // Create a feed instance that will grab Digg's feed.
    var feed = new google.feeds.Feed("http://localhost:8082/frevvo/web/tn/billy.com/api/apps");
    //var feed = new google.feeds.Feed("http://www.digg.com/rss/index.xml");
  if (!feed) {
      alert("feed object not created");
  } 
  console.log("loading feed");
  // Calling load sends the request off.  It requires a callback function.
  feed.load(feedLoaded);
}
Dan Lowe
  • 51,713
  • 20
  • 123
  • 112
birwin93
  • 93
  • 6

1 Answers1

0

The only place where you appear to be setting a port is where you specify the URL http://localhost:8082/frevvo/web/tn/billy.com/api/apps.

Change that URL to an RSS feed somewhere that doesn't use a non-standard port like that and this error will almost certainly go away.

For testing, I'll often go to a news web site and grab their RSS feed URL, e.g., http://rss.cnn.com/rss/cnn_topstories.rss.

Trott
  • 66,479
  • 23
  • 173
  • 212