public function __construct($placename) { $base = "https://maps.googleapis.com/maps/api/geocode/json"; $args = array(); $args["address"] = $placename; $fetcher = new JSONFetcher($base, $args); $result = $fetcher->run(); $this->lat = $result->results[0]->geometry->bounds->northeast->lat; $this->lng = $result->results[0]->geometry->bounds->northeast->lng; }
public function __construct($lng, $lat, $school) { $url = 'https://api.foursquare.com/v2/venues/search'; // Plz don't hack me :) $client_id = "GI4EIXWJAYECZ0YD1DVOFCACRUHIAJA2K4MLTSCNF5QHBANC"; $client_secret = "24SFWBOE2LK4MC3ITD3JVZEX4VPKIV3N3IM4QO0WP4LJ0HND"; $args = array('v' => 20130815, 'client_id' => $client_id, 'client_secret' => $client_secret, 'll' => $lat . ',' . $lng, 'query' => $school); $fetcher = new JSONFetcher($url, $args); $result = $fetcher->run(); $this->id = $result->response->venues[0]->id; }
public function __construct($lng, $lat, $school) { $client_id = "874cce6718bf4b2db62677a9cc754a43"; $distance = "700"; $foursquare = new Foursquare($lng, $lat, $school); $locationArgs = array('foursquare_v2_id' => $foursquare->getID(), 'client_id' => $client_id); $locationSearchBase = "https://api.instagram.com/v1/locations/search"; $locationFetcher = new JSONFetcher($locationSearchBase, $locationArgs); $locationResults = $locationFetcher->run(); $id = $locationResults->data[0]->id; $base = "https://api.instagram.com/v1/locations/{$id}/media/recent"; $args = array('client_id' => $client_id); $fetcher = new JSONFetcher($base, $args); $result = $fetcher->run(); $image_url = $result->data[0]->images->standard_resolution->url; $this->image_url = $image_url; }