trigger_error("OAuth fail: " . print_r($e, true)); ?> Something failed during the OAuth data fetch from google! Are you sure you have <a href='https://www.google.com/latitude/history'>Google Latitude location history</a> enabled? <?php exit; } $lastTimestamp = $lastLat = $lastLong = null; $json = json_decode($oauth->getLastResponse()); if (!$json->data->items) { print "You don't seem to have a latitude location history yet! Come back when you're older."; exit; } foreach ($json->data->items as $location) { if ($lastTimestamp && $lastLat != $location->latitude && $lastLong != $location->longitude) { $scrobbles = $fetcher->fetchScrobbles($_GET['user'], $location->timestampMs, $lastTimestamp, $location->latitude, $location->longitude); if ($scrobbles) { $address = $fetcher->fetchAddress("{$location->latitude},{$location->longitude}"); print date('r', $location->timestampMs / 1000) . " to " . date('r', $lastTimestamp / 1000) . ": <b>{$address}\n</b><br>"; print "<ul>"; foreach ($scrobbles as $scrobble) { print "<li>{$scrobble['artist']} - {$scrobble['track']}</li>\n"; $foundScrobbles = 1; } print "</ul><br>"; flush(); ob_flush(); } } // Collapse times in the same place if (!$lastTimestamp || $lastLat != $location->latitude && $lastLong != $location->longitude) {