Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I get geo coordinates out of the JSON? Twitter API
    primarykey
    data
    text
    <p>This is what the JSON outputs </p> <pre><code>{ "created_at": "Wed, 09 May 2012 22:13:32 +0000", "from_user": "EastCClothing", "from_user_id": 119699125, "from_user_id_str": "119699125", "from_user_name": "Tester23", "geo": { "coordinates": [ 54.9742, -1.5974 ], "type": "Point" }, "id": 200347799861198850, "id_str": "200347799861198849", "iso_language_code": "pt", "metadata": { "result_type": "recent" }, "profile_image_url": "http://a0.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "profile_image_url_https": "https://si0.twimg.com/sticky/default_profile_images/default_profile_0_normal.png", "source": "&amp;lt;a href=&amp;quot;http://twitter.com/download/android&amp;quot; rel=&amp;quot;nofollow&amp;quot;&amp;gt;Twitter for Android&amp;lt;/a&amp;gt;", "text": "#CM0655 GEO", "to_user": null, "to_user_id": 0, "to_user_id_str": "0", "to_user_name": null }, </code></pre> <p>What I am trying to do is get a hold of the coordinates so that I may use them with google maps api, I am able to access all the other details fine but can't access the coordinates through what I expected 'json.results[i].geo.coordinates'. Here's my JQuery</p> <pre><code>$(function(){ function searchTweets() { var url='http://search.twitter.com/search.json?callback=?&amp;q=cm0655'; $.getJSON(url,function(json){ var output = []; for (var i = 0, len = json.results.length; i &lt; len; i++) { output.push('&lt;p id="tweet"&gt;&lt;img id="tweetImage" src="' + json.results[i].profile_image_url + '" width="48" height="48" /&gt;&lt;span id="tweetText"&gt;' + '&lt;a href="http://twitter.com/' + json.results[i].from_user + '"&gt;' + json.results[i].from_user + "&lt;/a&gt; " + json.results[i].text + "&lt;br /&gt;" + json.results[i].created_at + '&lt;/p&gt;' + json.results[i].geo.coordinates + '&lt;/span&gt;'); } $("div.twitter2").html(output.join('')).slideDown('slow'); }); } var timer = setInterval(searchTweets, 20000); searchTweets(); }); </code></pre> <p>Many thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload