Giter VIP home page Giter VIP logo

twitteroauth's Introduction

TwitterOAuth Build Status Issues Count Latest Version Downloads this Month


Important TwitterOAuth is in maintenance mode, no new feature development is planned.

The most popular PHP library for Twitter's OAuth REST API.

See documentation at https://twitteroauth.com.

PHP versions listed as "active support" or "security fixes only" are supported.

Twitter bird

twitteroauth's People

Contributors

abraham avatar apizzini avatar bytestream avatar chrisbarr avatar christiaan avatar dbergey avatar dependabot-preview[bot] avatar dependabot[bot] avatar eliuflorez avatar filipocoma avatar gitnchez avatar gopi1410 avatar hborras avatar hkiciy avatar icyapril avatar ivan94 avatar jeffreyroberts avatar jpuck avatar jtojnar avatar kinoute avatar paazmaya avatar patricknelson avatar philgyford avatar rafasashi avatar ritey avatar rramsden avatar swop avatar szepeviktor avatar viniychuk avatar zerquix18 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  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

twitteroauth's Issues

getAccessToken() gives PHP warning when the oAuthRequest doesn't succeed

Undefined index: oauth_token in /var/www/html/includes/twitteroauth/twitteroauth.php on line 118
Undefined index: oauth_token_secret in /var/www/html/includes/twitteroauth/twitteroauth.php on line 118

Although I have received this error multiple times, I do not have any instances of storing bad data, presumably because I ensure the http_code is 200 before accepting the token values.

Since nowhere else in the library do you check the http_code before performing operations, I didn't want to go ahead and add that in (because you might prefer isset() or something on the $token or there might be an issue with return codes that I'm not considering) and give you first shot at it.

I also have this same error as occurring in getRequestToken (line 82), and I assume it would also occur in getXAuthToken(), though I don't use this function.

Cannot redeclare class OAuthException

Im getting an error, please help

Fatal error: Cannot redeclare class OAuthException in /home/vietnam/public_html/twitteroauth/OAuth.php on line 8

Documentation SESSION mention

In the documentation, it should be mentioned before step 6 that you need the save the temporary tokens in the session.

PHP Version 5.3.2 on EC2 with Canonical ami-4b4ba522

I setup a new EC2 instance using the Ubuntu 10.04 Lucid Canonical 64bit EBS boot ami-4b4ba522. After setting up apache and PHP Version 5.3.2-1ubuntu4.2 I tested my code and the twitteroauth sample and it won't work. it was working on another EC2 instance, the Fedora LAMP Web Starter.

When I try to run the Twitter OAuth PHP example it just stops on the redirect.php page with nothing showing. No error, nothing. Any ideas?

Update documentation

In TwitterOAuth->getAccessToken()

if (!empty($oauth_verifier)) {
$parameters['oauth_verifier'] = $oauth_verifier;
}

'oauth_verifier' should be 'oauth_token' as by oauth specifications.

OAuthRequest::version = '1.0a'; should be 1.0'

Not able to tweet

Hi,

When I tried tweeting I got the error message
statuses/update 401 110 Array ( [status] => Tue, 10 Aug 10 07:18:18 +0000 )
stdClass Object ( [request] => /1/statuses/update.json [error] => Read-only application cannot POST ) ...

Can someone please help me out with this ?

Regards,
Prateek

Problem with a POST sent

Hi guys! So my browser app was checked in the radio button R&W on dev.twitter.com
but don't send nothing! I can get the twitters and in the check connect is ok

get('statuses/user_timeline', array()); echo '
    '; foreach($result as $node){ printf('
  1. %s
  2. ','http://twitter.com/' . $node->user->screen_name. '/status/' . $node->id, $node->text); } }else{ $result = $connection-> post('statuses/update', array( 'status' => $msg )); var_dump($result); print_r($connection); } ?>

    AnyOne?

Failed to validate oauth signature and token

i 'am using Abraham Williams Twitter OAuth class to connect to twitter
and post through my website.

Earlier it was working fine but nowdays giving error "Failed to validate
oauth signature and token".

Kindly provide me solution as all thing must be right in my codingg cause
one day before all was working fine.

xAuth - bug - 401 error

It may be a bug in the library with xAuth

I make calls to - favorites/create with an ID parameter using "xAuth"

$response = $connection->get ( 'favorites/create', array ('id' =>
$status_id ) );

but I always getting 401 "Not authorized" Error

/1/favorites/create.json?
id=16170711730&oauth_consumer_key=vfM8qYNAEBfZsofKDNX65Q&oauth_nonce=bde7b35f5206ebc8a2cc31a7ea2b86ac&oauth_signature=V6%2BeC7%2FODp42W6GPV4EDWNpvSqY
%3D&oauth_signature_method=HMAC-
SHA1&oauth_timestamp=1276713005&oauth_token=13073932-
seUruGITdpHxCJsoUhpjectP4hpdRubW62Q7nftyA&oauth_version=1.0

On the other hand, The exact same request using "Basic
Authentication", It will work fine. I either getting

  • You have already favorited this status.
  • Favorites added

statuses/update and in_reply_to_status_id

Hi
When I make a call like this:

$connection->post('statuses/update',
array("status" => "Test",
        "in_reply_to_status_id"=>2314302740));

the posted tweet is without in reply to label. So this option "in_reply_to_status_id" doesn't seem to work.
What could it be the problem?

Thanks.

Errors for wrong tokens

Hi.
If user revoke access for my application I will have not valid tokens.
So I just try pass not valid tokens:

$to = new TwitterOAuth($api_key, $api_secret, '12345', '12345');

$tok = $to->getAccessToken();

print_r($tok);

and get following:

Array ( [ "1.0" encoding="UTF-8"?> /oauth/access_token?oauth_version=1.0 [amp;oauth_nonce] => 48654496b8fbe060d74972810fb94643 [amp;oauth_timestamp] => 1250690995 [amp;oauth_consumer_key] => c7VKUD2l378PM1nA3nv3ng [amp;oauth_token] => 12345 [amp;oauth_signature_method] => HMAC-SHA1 [amp;oauth_signature] => HOr7NT0M/gfNjcQxhxEO8hHCW4Q= Invalid / expired Token )

How can I catch errors for wrong tokens?
Thanks.

Incorrect Signature when public $decode_json = FALSE

Our server is not on PHP 5.2 yet so we do not have json_decode available. I changed "public $decode_json = FALSE; " in twitteroauth to eliminate script errors when envoking json_decode. Below is my single user request:

$connection = new TwitterOAuth($consumer_key, $consumer_secret, $oauth_token, $oauth_token_secret);
$status = $connection->post("statuses/update, array('status' => $msg)");

The result is:

/1/statuses/update,
Incorrect signature

Any help would be greatly appreciated.
LAR

Fix notices in get_normalized_http_url()

You should replace
$port = @$parts['port'];
...
$path = @$parts['path'];

to
$port = (isset($parts['port']) ? $parts['port'] : false);
$path = (isset($parts['path']) ? $parts['path'] : false);

Send status

i am using version 0.1.1.
How can i send my status from textarea.

direct_messages/new

Hi there,
I cannot send direct messages using:

$message = urlencode("testando a dirrect message");

$myfriend = "38655119";

$test = $twitteroauth->POST('direct_messages/new', array('user' => $myfriend),
array('text' => $message));

print_r($test);

I get:

stdClass Object
(
[request] => /1/direct_messages/new.json
[error] => Invalid request.
)

Any thoughts?
Thanks.

On PHP 5.1.6

I am testing this on a server with PHP 5.2 and now works like a charm. Wondering what I need to do to make this work on 5.1.6. Let's assume that an update from 5.1.6 to 5.2 is not yet feasible.

get the user id

I'm tryibng to get the user_id but I cant seem to do it. The get account/credentials does not return what it is supposed to. When a call the method from the API Console it returns a log more values but when I do it with this library it returns barely anything(pasted below). Any help in resolving this would be appreciated.

Returned:

    {"statuses_count":1232,"following":false,"time_zone":"Skopje","description":"Young,promising lad interested in server-side programing. PHP to be exact.","show_all_inline_media":false,"profile_background_image_url":"http://a3.twimg.com/profile_background_images/123470775/twt.jpg","friends_count":332,"profile_link_color":"004003","profile_image_url":"http://a2.twimg.com/profile_images/984827302/icon_1_normal.jpg","status":{"geo":null,"place":null,"coordinates":null,"in_reply_to_screen_name":"zuberot","in_reply_to_user_id":17517391,"favorited":false,"source":"web","contributors":null,"created_at":"Wed Aug 04 17:53:48 +0000 2010","in_reply_to_status_id":20321437802,"truncated":false,"id":20321877224,"text":"@zuberot \u043a\u043e\u0433\u0430 \u0442\u0435 \u0438\u043c\u0430\u043b\u043e \u043d\u0430 \u0432\u0435\u0441\u0442\u0438 \u0431\u0435??"},"contributors_enabled":false,"notifications":false,"url":null,"geo_enabled":true,"profile_background_tile":true,"favourites_count":2,"profile_sidebar_fill_color":"00870e","screen_name":"macstr1k3r","location":"Kumanovo, Macedonia","verified":false,"profile_sidebar_border_color":"002e01","follow_request_sent":false,"protected":false,"lang":"en","created_at":"Sun Dec 13 23:39:28 +0000 2009","profile_background_color":"326c00","name":"\u0414\u0430\u0440\u043a\u043e \u0421\u0442\u043e\u0458\u043a\u043e\u0432\u0441\u043a\u0438","id":96649646,"listed_count":8,"profile_use_background_image":false,"utc_offset":3600,"profile_text_color":"000000","followers_count":181}    

'incorrect signature' while updating status due to wrong encoding in library

While using your latest library version, i expire the following issue while sending a tweet like this:

$tweet = "http://bit.ly/123456 Content with Umlaut Ö abc";

$response = $connection->post('statuses/update', array('status' => $tweet, 'in_reply_to_status_id' => ''));

$response is:

stdClass Object
(
    [request] => /1/statuses/update.json
    [error] => Incorrect signature
)

When i urlencode the whole tweet, it will send without problems, but then the tweet is shown up urlencoded at twitter. So i guess there is an encoding problem in the library.

The Tweet above is a generated tweet wich is utf-8 encoded.

FYI: The signature and all my tokens are correct!

I assume the german "umlauts" like "ä ö ü ß" are the problem. when i replace "ö" with "oe" everything works fine. But these Signs should not throw this error, they are utf8 encoded.

authentication problem

Just testing the library on my local machine

I defined the callback URL as following
define('OAUTH_CALLBACK', 'http://localhost/callback.php');

but getting error message when clicking "Sign in with Twitter" button -
"Could not connect to Twitter. Refresh the page or try again later."

if the callback URL is changed to
define('OAUTH_CALLBACK', NULL);

then I can get to twitter "Login Page" and enter username + password, twitter returned with a PIN number.

How can I redirect to the test.php like the "Live Example" does?
http://twitteroauth.labs.poseurtech.com/index.php

Fatal error: Cannot redeclare class OAuthException

Hello,
everything was fine until a few hours ago.
I think my hoster (hostgator.com) must have installed some PECL extension without asking or informing me.
What shall I do now? I already sent them a ticket. But maybe I can fix it myself.

sign out of twitter

I'm trying to create a sign out button from twitter, not only clear sessions.

The problem is when users who use public computers log in on the twitter app on my website, and then close my website they are still logged in on twitter.

I couldn't find anything in the documentation about this, and the twitter dev documentation didn't help.

Any tips?

Update lastStatusCode()

lastStatusCode() should be updated, as the $http_status variable doesn't logger exists:

function lastStatusCode() { return $this->http_info['http_code']; }

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.