Skip to content

Instantly share code, notes, and snippets.

@tektoh
Created June 28, 2014 04:32
Show Gist options
  • Save tektoh/832f4eb337401ac88699 to your computer and use it in GitHub Desktop.
Save tektoh/832f4eb337401ac88699 to your computer and use it in GitHub Desktop.
20140628 - 旅好きエンジニアもくもく会 foursquare api をさわってみる。
<?php
use Cake\Network\Http\Client;
public function fsq() {
$client = new Client();
$url = 'https://api.foursquare.com/v2/venues/search';
$res = $client->get($url, [
'll' => '44.3,37.2',
'client_id' => 'クライアントID',
'client_secret' => 'シークレットキー',
'v' => '20131016'
]);
var_dump($res->body());
}
?>
CakePHP3のHTTPクライアントクラスを使ってみた。
認証不要なアクセス:https://developer.foursquare.com/overview/auth#userless
APIのバージョンとか: https://developer.foursquare.com/overview/versioning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment