Created
March 27, 2013 11:41
-
-
Save kayalshri/5253586 to your computer and use it in GitHub Desktop.
Foursquare connect by using oauth in PHP, [PHP, oauth, foursquare, authentication]
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
<?php | |
# include oauth class | |
include "socialmedia_oauth_connect.php"; | |
$oauth = new socialmedia_oauth_connect(); | |
$oauth->provider="Foursquare"; | |
$oauth->client_id = "CVH2LUFNUVAYQVPYCECHZ0FGOKEQHLKIRJBGHBPQVV0T1ZX1"; | |
$oauth->client_secret = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; | |
$oauth->scope=""; | |
$oauth->redirect_uri ="http://ngiriraj.com/socialMedia/oauthlogin/foursquare.php"; | |
$oauth->Initialize(); | |
$code = ($_REQUEST["code"]) ? ($_REQUEST["code"]) : ""; | |
if(empty($code)) { | |
$oauth->Authorize(); | |
}else{ | |
$oauth->code = $code; | |
# print $oauth->getAccessToken(); | |
$getData = json_decode($oauth->getUserProfile()); | |
$oauth->debugJson($getData); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment