Git Product home page Git Product logo

foursquare-async's People

Contributors

dingram avatar jmathai avatar meza avatar ssx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foursquare-async's Issues

Seems to be timing out when calling getAccessToken?

I've taken the original sample test and tried to put our credentials in it and it times out when trying to get the access token.. Here is my stripped down version sans credentials.

<script type="text/javascript"> function viewSource() { document.getElementById("source").style.display = "block"; } </script>

Simple test to make sure everything works ok

View the source of this file


Generate the authorization link

getAuthorizeUrl($redirectUri); ?>

<h2>Display your own badges</h2>
<?php
if(!isset($_COOKIE['access_token'])) {
    $token = $fsObjUnAuth->getAccessToken($_GET['code'], $redirectUri);
    setcookie('access_token', $token->access_token);
    $_COOKIE['access_token'] = $token->access_token;
}
$fsObjUnAuth->setAccessToken($_COOKIE['access_token']);
?>

Version 2 out

I'm going to try and update the current lib for version 2. Will take a while!

It hasnt been updated already right? V1 will stop working shortly.

Server side calls via proxy server

I think it is an issue, please correct me if it is not:

My production server needs to make server side calls using a proxy server.

Uploading the working code in my test server to the production server I have a time out connection error.
So I have edited EpiFoursquare.php and I have added:

curl_setopt($ch, CURLOPT_PROXY, 'proxy.theproxy.net:8080');

at the end of:

if($method === 'GET')
$url .= is_null($params) ? '' : '?'.http_build_query($params, '', '&');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $this->requestTimeout);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);

Now I have:

Fatal error: Uncaught exception 'EpiFoursquareException' in EpiFoursquare.php:236 Stack trace: #0 EpiFoursquare.php(192): EpiFoursquareException::raise(Object(EpiCurlManager), false) EpiFoursquareJson->__get('access_token') #2 {main} thrown in EpiFoursquare.php on line 236

Thanks

getAccessToken() building malformed query string (Fix Included)

public function getAccessToken($code, $redirectUri)
{
$params = array('client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'grant_type' => 'authorization_code', 'redirect_uri' => $redirectUri, 'code' => $code);
$qs = http_build_query($params);
return $this->request('GET', "{$this->accessTokenUrl}?{$qs}");
}

Fix

public function getAccessToken($code, $redirectUri)
{
$params = array('client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'grant_type' => 'authorization_code', 'redirect_uri' => $redirectUri, 'code' => $code);
$qs = http_build_query($params);
return $this->request('GET', "{$this->accessTokenUrl}", $params); //line to change
}

Exception Thrown when retrieving an access token

Exception Thrown when retrieving an access token. This is because curl returns response code of 0 which means it couldn't verify the ssl certificate. To fix just add

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

to the curl request.

Fix uploaded

Uncaught Exception on Refresh

I am new to OAuth and this is my code that gets the token.

setToken($_REQUEST['oauth_token'],$_SESSION['secret']); $token = $foursquareObj->getAccessToken(); $foursquareObj->setToken($token->oauth_token, $token->oauth_token_secret); // user details $foursquareUSER = $foursquareObj->get_user(); $user_details = $foursquareUSER->response; //user history $foursquareHIST = $foursquareObj->get_history(); $user_history = $foursquareHIST->response; $i=0; ?>

Any time i refresh this page or paste the URL into another tab i get the following error:

Fatal error: Uncaught exception 'EpiOAuthUnauthorizedException' in /home/xxxxxxxxxx:374 Stack trace: #0 /home/xxxxxxxxxxxxxx(346): EpiOAuthException::raise(Object(EpiCurlManager), false) #1 /home/xxxxxxxxxxxxx(17): EpiOAuthResponse->__get('oauth_token') #2 {main} thrown in /home/xxxxxxxxxxxxxxx.php on line 374

Any advice or insight would be greatly appreciated.

Json_decode returns 'NULL'

Dear Forum,

I have a problem, i am using the sample script to get the ID of a venue. But if i use Json_decode to decode the Json it returns 'NULL' on the screen.

The script:

get('/venues/search',array('ll'=>'52.3655230,4.8853789')); ``` ?>
  <pre><?php var_dump(json_decode($venue->response->groups[0]->items[0])); ?></pre>

Hopefully you guys can help me.

Kind Regards,

Jasper Vergers

User-Agent doesn't get set

User-Agent doesn't get set on any request I make.

This happens in Chrome and Mozilla running on Linux.

Documentation doesn't match code

Hi - I started to use this library. I didn't really understand how calls such as get_user were working as I couldnt find functions in the code that matched the name. I then checked the wiki, any of the methods from there I used threw exceptions.

Composer.json

Hey, could you add a composer.json and get this up on Packagist?

Untitled

I am having a issue with this API. Getting exception with simpletest.php

EpiCurlManager Object
(
[key:private] => Resource id #4
[epiCurl:private] => EpiCurl Object
(
[mc:private] => Resource id #5
[msgs:private] =>
[running:private] => 0
[execStatus:private] => 0
[selectStatus:private] =>
[sleepIncrement:private] => 1.1
[requests:private] => Array
(
[Resource id #4] => Resource id #4
)

        [responses:private] => Array
            (
                [Resource id #4] => Array
                    (
                        [data] => 
                        [code] => 0
                        [time] => 0
                        [length] => 0
                        [type] => 
                        [url] => https://api.foursquare.com/v2/venues/search?ll=40.7%2C-74&client_id=XXXXX&client_secret=XXXXX
                    )

            )

        [properties:private] => Array
            (
                [code] => 2097154
                [time] => 3145731
                [length] => 3145743
                [type] => 1048594
                [url] => 1048577
            )

    )

)

Fatal error: Uncaught exception 'EpiFoursquareException' in foursquare\lib\EpiFoursquare.php:253
Stack trace:
foursquare\lib\EpiFoursquare.php(209): EpiFoursquareException::raise(Object(EpiCurlManager), false)
oursquare\index.php(20): EpiFoursquareJson->__get('response')
#2 {main}

thrown in foursquare\lib\EpiFoursquare.php on line 253

Please advise me!

Create get/set methods for user-agent

From: http://groups.google.com/group/foursquare-api/web/api-documentation

Set your User-Agent header to something identifiable. Default identifiers like "Mozilla" or "libwww-perl/5.808" may get banned from time to time because of rate limits.

Directly editing EpiFoursquare.php creates the issue of having to redo the change when an update is applied.

Here is what I added to my file, right above the OAUTH methods:

/* House keeping methods */
public function setUserAgent($userAgent) {
$this->userAgent = $userAgent;
}

public function getUserAgent() {
return $this->userAgent;
}

I looked at adding the ability to set this with the constructor, but that would be too problematic. Get/set methods are easy enough.

API v2 not currently supported

Foursquare is making a move in favor of their next OAuth2 API version. Current OAuth is going to be deprecated in mid-2011, just a few months away.
Are you planning to upgrade foursquare-async to support it? I'm not sure I can upgrade it myself. Currently I didn't find any suitable libraries which support it.

timeout + Apache goes nuts

When I try to run getAccessToken() with the code that comes back as a param of the redirect URL...I get nothing.

localhost never loads, the browser status indicator just spins around and apache's CPU usage goes through the roof and my MBPs fans all go to full speed.

I'm supposing this has something to do with cURL?

Anyone else ever experience anything like this?

getAccessToken

getAccessToken is adding a second ? and client_id and client_secret to the URL before it curls it.

Basic example does not work

$twitterObj = new EpiTwitter(
Hidden::TWITTER_CONSUMER_KEY,
Hidden::TWITTER_CONSUMER_SECRET,
$oauth_token,
$oauth_token_secret);

$twitterObj->useAsynchronous(true);

// neither one of the following work, and I've tried many many variations
$results = $twitterObj->get("users/lookup", array("user_id" => 2344));
$creds = $twitterObj->get('/account/verify_credentials.json');

echo $creds->responseText;
exit;

The result is that the process just hangs, or sometimes the whole server hangs :(
Sometimes it throughs an exception and I get error_code=0 with no error message.

I know the authentication is correct because it works just fine with other twitter libraries.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.