Created
July 23, 2011 16:30
-
-
Save cole-gillespie/1101606 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this is an example twitter call for geolocated tweets | |
//all you need is a lat lng to get tweets from anywhere | |
//in the world | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
//only get the first 5 pages | |
//since we are only interested | |
//in recent tweets | |
for (z = 0; z <= 5; z++) { | |
//ask twitter to give you tweets | |
var jqxhr = $.getJSON("http://search.twitter.com/search.json?callback=?", { | |
geocode: '51.499054,-0.133524,1mi', | |
rpp: "100", | |
result_type: "recent", | |
page: z + 1 | |
}, function (data) { | |
//loop over every tweet and see if it contains geo data | |
$.each(data.results, function (idx, t) { | |
//if this tweet has data save it to array tweetlist | |
if (t.geo) { | |
tweetList.push(t); | |
} | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment