Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I thought I'd add the $.each method just in case anyone went down that path.</p> <pre><code> // The code below uses the Twitter API found here https://dev.twitter.com/docs to search for the latest mention of CM0655 (module code). var twitterURL = "http://search.twitter.com/search.json?q=%23CM0655"; function twitterSearch() { // Create the weather function $.ajax({ url: twitterURL, //http request string for the weather service dataType: "jsonp", success: function(JSON) { // If successful parse the JSON data $('#twitterSearch').html(""); $.each(JSON.results, function(i,tweet){ var tweeterID = tweet.from_user_id; var dateFormat = tweet.created_at; var newDate = dateFormat.replace('+0000', ''); var title = 'title="Tweeted from"'; var id = tweet.id; var locData = tweet.geo; getCordsData(locData); $('#twitterSearch').append('&lt;li id="tweet' + id + '" class="mainP tweet"&gt;&lt;img class="tweetImage" src="'+ tweet.profile_image_url +'" height="20" width="20" /&gt; &lt;a class="tweetLink" href="http://twitter.com/' + tweet.from_user + '" target="_blank"&gt;' + tweet.from_user + '&lt;/a&gt; on the ' + newDate + ' &lt;br /&gt; tweeted&lt;span id="tweetTextColor"&gt;: ' + tweet.text + '&lt;/span&gt;&lt;/li&gt;'); }); //alert("Ajax text"); setTimeout(twitterSearch, 10000); } }); // End of ajax } // End of function function getCordsData(data){ if(data == null){ data = "No location data found!"; alert(data); }else{ var long = data['coordinates'][0]; var lat = data['coordinates'][1]; alert("long:" + long + "Lat:" + lat); } } </code></pre>
 

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