Я использую jQuery для получения и отображения твитов, касающихся 2 футбольных команд, в формате json.В настоящее время я выводю текст и идентификатор пользователя, но я планирую разместить эти твиты на карте Google.Но сначала мне нужно захватить местоположение твитов.любые идеи о том, как этого добиться.
Базовый код пока приведен ниже;
<script type="text/javascript">
$(document).ready(function(){
var team1, team2;
team1 = '<?php echo $_GET["team1"]; ?>';
team2 = '<?php echo $_GET["team2"]; ?>';
var url1="http://search.twitter.com/search.json?q=%23"+team1+"&callback=?";
var url2="http://search.twitter.com/search.json?q=%23"+team2+"&callback=?";
$.getJSON(
url1,function(results){ // get the tweets
var res1 = results.results[0].text;
var userID1 = results.results[0].from_user_id;
$("#last-tweet1").html(res1 + "<p>user id: " + userID1); // get the first tweet in the response and place it inside the div
});
$.getJSON(
url2,function(results){ // get the tweets
var res2 = results.results[0].text;
var userID2 = results.results[0].from_user_id;
$("#last-tweet2").html(res2 + "<p>user id: " + userID2 + "</p>"); // get the first tweet in the response and place it inside the div
});