The Artima Developer Community
Sponsored Link

Java Buzz Forum
Forget the Feed URL

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
dion

Posts: 5028
Nickname: dion
Registered: Feb, 2003

Dion Almaer is the Editor-in-Chief for TheServerSide.com, and is an enterprise Java evangelist
Forget the Feed URL Posted: Jul 17, 2007 5:16 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by dion.
Original Post: Forget the Feed URL
Feed Title: techno.blog(Dion)
Feed URL: http://feeds.feedburner.com/dion
Feed Description: blogging about life the universe and everything tech
Latest Java Buzz Posts
Latest Java Buzz Posts by dion
Latest Posts From techno.blog(Dion)

Advertisement

Having to type in feed URLs, or grep them from view source (as you don't use the browser specific system) can be a pain.

The Google AJAX APIs team has created a simple way to find feeds, and to locate feeds in a URL.

findFeeds will do a Google search and return entries and feeds related to the search.

Here is an example at work:

findfeeds.png

The code you will write will look like this:

google.feeds.findFeeds(query, function(result) {
  var el = document.getElementById("feedControl");

  if (result.error || result.entries.length <= 0) {
    el.innerHTML = 'No Results Found';
    return;
  }

  // create a feed control
  var feedControl = new google.feeds.FeedControl();

  // Grab top 4..
  for (var i = 0; i < 4; i++) {
    feedControl.addFeed(result.entries[i].url, result.entries[i].title);
  }

  feedControl.setLinkTarget(google.feeds.LINK_TARGET_BLANK);
  feedControl.setNumEntries(2);
  feedControl.draw(el);
}
lookupFeed takes a URL and returns the feed. E.g.
function newSlideShow(user) {
  showStatus('Resolving feed for ' + user);
  var url = 'http://www.flickr.com/photos/' + user;
  google.feeds.lookupFeed(url, lookupDone);
}

function lookupDone(result) {
  if (result.error || result.url == null) {
    showStatus('Could not locate feed for user');
    return;
  }

  showStatus('Found Photo Feed');
  // We need to switch over from Atom to RSS to get Yahoo Media for slideshow..
  var url = result.url.replace('format=atom', 'format=rss_200');
  showSlideShow(url);
}
Very nice indeed.

Read: Forget the Feed URL

Topic: Facebook Gets Google Analytics! Previous Topic   Next Topic Topic: Just Out of Reach

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use