Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API calls with no authentication #12

Open
ghost opened this issue Apr 22, 2011 · 4 comments
Open

API calls with no authentication #12

ghost opened this issue Apr 22, 2011 · 4 comments

Comments

@ghost
Copy link

ghost commented Apr 22, 2011

From what I undertand, some API calls like users/show and statuses/user_timeline do not require authentication. So how do I make these calls using Elliot's Twtter library without authenticating?

For example when I try to do this (before authenticating) an exception will be thrown.

$user = $this->tweet->call('get', 'users/show', array('screen_name' => 'somescreenname'));

Sorry if this is a dumb question.

@amboy00
Copy link

amboy00 commented Jul 7, 2011

That's correct. Just like performing a search, you should have to authenticate.

I'm also getting an exception.

@amboy00
Copy link

amboy00 commented Jul 7, 2011

It looks like it's making the right call too.

$feed = $this->tweet->call('get', 'users/show', array('screen_name' => 'amboy00'));

$url will be http://api.twitter.com/users/show.json?screen_name=amboy00 which works. $feed will come back bool(false)

@amboy00
Copy link

amboy00 commented Jul 7, 2011

I dont know if this will work for you, but I hardcoded an exception in tweet.php.

protected function _httpRequest($method = null, $url = null, $params = null)
{
    if( empty($method) || empty($url) ) return FALSE;
    if ( empty($params['oauth_signature']) ) $params = $this->_prepareParameters($method, $url, $params);

    //ADD THIS EXCEPTION                    
    if ( $url == 'http://api.twitter.com/users/show.json' )
    {
        $params['oauth'] = null;
    }

@egfx
Copy link

egfx commented Jul 19, 2011

amboy00, thanks for this! works perfect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants