Skip to content

Commit

Permalink
Merge pull request #1974 from AaronKalair/fix-foursquare-plugin
Browse files Browse the repository at this point in the history
Fixes Foursquare plugin by adding date parameter to API calls. Closes #1789 closes #1817
  • Loading branch information
ginatrapani committed Jun 16, 2014
2 parents 0994e7c + c0ce149 commit 4cd713e
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function setUpFoursquareInteractions(array $options) {

// Create the OAuth link based on foursquares instructions here: https://developer.foursquare.com/overview/auth
$oauth_link = "https://foursquare.com/oauth2/authenticate?client_id=".$client_id."&response_type=code";
$oauth_link .= "&redirect_uri=".$redirect_uri;
$oauth_link .= "&v=20120829&redirect_uri=".$redirect_uri;
// Add the link for the user to click to the page
$this->addToView('oauth_link', $oauth_link);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ public function apiRequest($endpoint, $access_token, $fields=null) {
$date = getdate();

// Add the year month and day at the end of the URL
$url = $url."&v=".$date['year'].$date['mon'].$date['mday'];

$url = $url."&v=20120829";
// Get any results returned from this request
$result = Utils::getURLContents($url);

Expand Down
3 changes: 2 additions & 1 deletion webapp/plugins/foursquare/model/class.FoursquareCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ public function getOAuthTokens($client_id, $client_secret, $redirect_uri, $code)
'client_secret'=>urlencode($client_secret),
'grant_type'=>urlencode('authorization_code'),
'redirect_uri'=>urldecode($redirect_uri),
'code'=>urlencode($code)
'code'=>urlencode($code),
'v'=>'20120829'
);
$tokens = $this->api_accessor->rawPostApiRequest($access_token_request_url, $fields, true);
return $tokens;
Expand Down

0 comments on commit 4cd713e

Please sign in to comment.