Hi All,

I'm using Google Feed API to display a twitter search feed. I can't
for the life of me figure out how to access nested elements, i.e. uri,
and the second link element of the following feed template:

<entry>
    <id>tag:search.twitter.com,2005:1903087272</id>
    <published>2009-05-24T15:09:27Z</published>
    <link type="text/html" rel="alternate" href="http://twitter.com/
Dahl_Kaiser/statuses/1903087272"/>
    <title>Put the #terrorist in our max prisons in Gen Population
wanna take bets on how fast the lifers would let these wimps live?
#Cheney #tcot</title>
    <content type="html">Put the &lt;a href="http://search.twitter.com/
search?q=%23terrorist"&gt;#terrorist&lt;/a&gt; in our max prisons in
Gen Population wanna take bets on how fast the lifers would let these
wimps live? &lt;a href="http://search.twitter.com/search?q=
%23Cheney"&gt;&lt;b&gt;#Cheney&lt;/b&gt;&lt;/a&gt; &lt;a href="http://
search.twitter.com/search?q=%23tcot"&gt;#tcot&lt;/a&gt;</content>
    <updated>2009-05-24T15:09:27Z</updated>
    <link type="image/png" rel="image" href="http://s3.amazonaws.com/
twitter_production/profile_images/60860491/
Dahl_at_the_beach_normal.GIF"/>
    <twitter:source>&lt;a href="http://twitter.com/"&gt;web&lt;/a&gt;</
twitter:source>
    <twitter:lang>en</twitter:lang>
    <author>
      <name>Dahl_Kaiser (Dahl Kaiser)</name>
      <uri>http://twitter.com/Dahl_Kaiser</uri>
    </author>
  </entry>

Here's the code I am using:

var tweets = function(){
        //alert("Tweet");
        //#cheney for testing :)
        var feed = new google.feeds.Feed("http://search.twitter.com/
search.atom?lang=en&q=+%23cheney");
        feed.setResultFormat(google.feeds.Feed.MIXED_FORMAT);
        feed.load(function(result) {
  if (!result.error) {
    var container = document.getElementById("feed");
    for (var i = 0; i < result.feed.entries.length; i++) {
      var entry = result.feed.entries[i];
          var content = entry.content;
          var author = entry.author;
          var authorLink = google.feeds.getElementsByTagNameNS(entry.xmlNode,
"author")[0];
          var authorUri = authorLink.firstChild.nodeValue;
        //      alert(authorUri);

    }
  }
});



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google AJAX APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-AJAX-Search-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to