My friend and I are working on an app that extracts tweets in and
around a location and displays the tweets as text as well as on the
map. We are getting tweets with geo location but are wondering how to
extract the data in the <google:location> tag. We are using PHP to
display the tweets. Along with the tweets I'd like to display the
location too (and then later on mark it on the map.

Here is an entry of the tweet in ATOM format:

    <link type="text/html" href="http://twitter.com/kath/statuses/
66218119324123136" rel="alternate"/>
    <title>Dazzling video: Plan of the City by Joshua Frankel, with
music by @juddgreenstein and @NOWEnsemble. http://bit.ly/kHXzAZ</title>
    <content type="html">Dazzling video: Plan of the City by Joshua
Frankel, with music by &lt;a href=&quot;http://twitter.com/
juddgreenstein&quot;&gt;@juddgreenstein&lt;/a&gt; and &lt;a
a&gt;. &lt;a href=&quot;http://bit.ly/kHXzAZ&quot;&gt;http://bit.ly/
    <link type="image/png" href="http://a1.twimg.com/profile_images/
185321700/Kath_normal.jpg" rel="image"/>
    <google:location>New York</google:location>
    <twitter:source>&lt;a href=&quot;http://twitter.com/
      <name>kath (Kath)</name>

Here is the code that we use to display the details of a Tweet.

foreach( $results->entry as $result )   // for ATOM

echo "<h3><a href=\"". $result->author->uri ."\">". $result->author-
>name ."<a/></h3><img src=\"". $result->link[1]->attributes()-
>href ."\" style=\"float: left;\"><p>". $result->content."</p><div

I was thinking more on the lines of $result->google:location.... Tried
all combinations. Nothing worked. Could not find anything on when
searching the Internet about this.

Would be great if anyone could answer this for us.


Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 

Reply via email to