Abraham's Twitter oAuth for 1.1 API?


#1

Does anyone know if the Twitter oAuth PHP library https://github.com/abraham/twitteroauth will be updated to support Twitter’s 1.1 API? I reached out to him but perhaps someone will fork it and update it as it doesn’t appear to have been touched in quite some time.

If not, perhaps some of us who utilize it may want to band together to fork it? Though if Abraham is working on it, that would be awesome.


#2

you can change in file: twitteroauth.php

public $host = “https://api.twitter.com/1/”;
to:
public $host = “https://api.twitter.com/1.1/”;

but … if i use the /1.1/ URL
i get in HEADER: [x_warning] => Invalid OAuth credentials detected
???
but results 're there ?


#3

Are you using an access token with your requests? Make sure you’re using an access token and that your system clock is sync with ours.


#4

The best way to update to the v1.1 is the following:

$connection = new TwitterOAuth(...); $connection->host = "https://api.twitter.com/1.1/";

That way you don’t have to edit twitteroauth.php.


#5

So what exactly are you supposed to replace the dots with on line 1?


#6

Oh, the keys right?


#7

Thank you very much, Abraham! Finally solved it with this line!


#8

@abraham I’m using twitteroauth to make a simple twitter account manager - thank you for releasing such an awesome library!

Every thing works beautifully with v1 api but I tried updating to 1.1 api and it’s now causing some errors - trying to perform a users/show works once but the second time the api is refusing the connection.

I ran the test.php that came with your twitteroauth github using v1.1 and it also doesn’t complete all the tasks now.

When I switch back to v1 everything works fine again.

Do you know what might be causing this?

Thanks again for twitteroauth.


#9

I am using tweet library in codeigniter for implementing login with twitter,It has been working fine in last 1 year but now it is not working fine,How can I update API 1.0 to 1.1 for implementing login with twitter functionality or please give the link for another library for implementing the same


#10

@WesymUser : I too have same problem. How to upgrade API 1.0 to 1.1. I am using twitter library for codeigniter… Got any updated library ?


#11

Checkout Abrahams comments above.

$connection = new TwitterOAuth(...); $connection->host = "https://api.twitter.com/1.1/";

Then look at the examples in index.php on Git. He has put it all there for you.

Dicely, done, Abraham!


#12

thanks my problem is Now solved.


#13

Thank you!
It helps me a lot to resolve my issue :slight_smile:


#14

It doesn’t seem to work for me. I have tried changing the $host variable on twitteroauth.php too.


#15

Whereto write this code?


#16

i change all number fromn 1.0 to 1.1 in twitteroath and oath file. then on calling back from twitter refresh the page. It hides the error :slight_smile:


#17

hello


#18

There are some other better twitter api library in github


#19

Hello


#20

@abraham your code is not working anymore for OAuth. It always throw an Exception “Failed to validate oauth signature and token”. Maybe you must test it yourself.