This is comment page 5 for Authenticating a Twitter Feed for OAuth API V1.1 - Timelines & streams »
Creating a Custom jQuery Twitter Feed (API v1.1) »
Creating a Twitter Search & Analytics tool »
Hi Again Tom; I almost did it, i need your help if it’s possible. I changed code like this, but now i have to change “&page” number manually. Is it possible to do a loop for 16 pages (3200 tweets) in this code ?
get(“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=”.$twitteruser.”&count=”.$notweets.”&page=”.$nopage.”&exclude_replies=”.$noreply);
echo json_encode($tweets);
?>
Hey this is rocking tom . would you please let me know that how to fetch all the tweets related to me …because with this we are able to fetch tweets which has been updated by us…
thanks in advance
I’m using this example to get the replies on a tweet but return json doesn’t include the replies at all.
Please help me on this. I’m using this url:
[link removed]
Also, if I want to get the replies of a particular tweet then how i’ll do it?
like sample url: https://twitter.com/MujeebFarooqi/status/459340704356261888
Thanks,
Mujeeb.
Hi Tom,
how you doing?
dude i want to get the replies of a particular feed like from this page https://twitter.com/MujeebFarooqi/status/459340704356261888
but i tried alot but not getting the replies from the JSON returned from api. How will i do this? any possible solution?
Really appreciate your help.
Thanks,
mujeeb.
$favorites = $twitteroauth->get(“https://api.twitter.com/1.1/favorites/list.json?count=1&screen_name=fiverr”);
foreach ($favorites as $favorite) {
echo $favorite->name .”;
}
What is the problem this line? I am not access this name value.
Where’s step 3 where you put the code in the HTML to display the tweet in the div?
Great Tutorial bro
Hi Tom,
Thanks very much for this – I am normally pretty good with implementing things like this but for some reason I keep getting a 500 error. I had it working fine on the Authenticating tutorial but not when I set it up to work with twitterfeed.js. It finds my get-tweets.php file but then I get a 500 error. I have tried everything to get it to work and as I say the path to the twitteroauth.php was fine on the original authentication method – it just seems to break when implemented into the JavaScript. I am trying to set this up on a WordPress site so maybe that’s the issue – if you could offer any guidance it would be much appreciated…
Thanks
Hi there, I keep getting this error message:
{“errors”:[{“message”:”Could not authenticate you”,”code”:32}]}
But there’s very little documentation online about how to solve it. I was just wondering if you had any thoughts!
Best,
Jack
I randomly get this error: Connection problem. Check file path and www vs non-www in getJSON request. Any ideas what’s causing this?
Hi !! I am making a website in asp language. How can I configure twitter feed for that ? I want the twitter to load one after the other in a fading animation.
Hi, I want to thanks for the great code. It has been working fine until recently the tweet page is empty and doesn’t load as usual.
When I check the error log it said:
[16-May-2014 06:34:12 UTC] PHP Warning: require_once(twitteroauth/twitteroauth.php): failed to open stream: No such file or directory in /data01/c2456538/public_html/twitter/get-tweets1.1.php on line 3
[16-May-2014 06:34:12 UTC] PHP Fatal error: require_once(): Failed opening required ‘twitteroauth/twitteroauth.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /data01/c2456538/public_html/twitter/get-tweets1.1.php on line 3
Any idea why because it was fine in the past.
Thanks for the script! I got it successfully setup including cache function -> xxxx-tweets.txt successfully written (83KB)
The .txt contains the tweets I need.
Question: How do I output only the latest tweet in php? Just in tweet form. Maybe with clickable links if they exist in a tweet.
Thanks again for this good piece of code.
Hi, thanks for the awesome tut. I have had it working for a couple months now but all of a sudden I started getting this error: Uncaught ReferenceError: exception is not defined twitterfeed.js:115
Any ideas on how I can fix this? I tried fixing it for an hour or so and can’t seem to figure it out.
here is a link http://wearerally.com (twitterfeed is at bottom of home page, currently getting the catching tweets message)
thanks!
Hey Tom, love your work! If I want to to include tweets from more than one user, how would I go on about this?
Can anyone help with issue:
How to separate information about tweets, that displays?
http://tinypic.com/r/9029ld/8
Unfortunately it is difficult to read it.
Thanks in advance!
First of all Thank you for this great post!
I am having one litlle issue I am receiving back this message :
{“errors”:[{“message”:”Could not authenticate you”,”code”:12345 bare in mind that’s not the real code but I am not sure if I can supply the code to the public so I ommit but the issue is that it couldn’t authenticate me for some reason unknow by me I appreciate if you can help me !
I surrender for making these procedure works. I cant run the the program it resulted with ‘Fatal error: Call to undefined function curl_init() in C:xampphtdocstesttwitteroauth.php on line 195;,Sorry i appreciate the tutorial but it wont work for me!!’
Hi, it looks very prety simple and awesome tutorial but I have a error
{“errors”:[{“message”:”Could not authenticate you”,”code”:32}]}
What can be the issue of this problem. I have already updated my keys but it doesn`t help
plz help
Hi Tom,
I’m a PHP newbie, so it’s probably a simple mistake on my end, but I’m getting
Fatal error: Class ‘TwitterOAuth’ not found in /home/afudge/dev.mindymillerofficial.com/twitter_feed/get-tweets.php on line 13
hi there ,
i know i sound a bit silly , but i have included the .php file using include/require_once … no trouble there . But it says that cannot find twitterOAuth class @line 13.. I have set the path and still it is not being able to access that class ..
Thanks and regards
hi there ,
i am getting an error of undefined offset on $connection->get() . Also tried to change https to http , cURL is up and running in my machine , confirmed it via phpinfo() … Will appreciate your help .
BTW .. Nice tutorial ๐
*Hey Tom,
*big thanks for the work!
*I have started a course on Tuts+ about tweets and ended up looking for the way how to implement tweets API v1.1
*Except keys, secret, tokens, username and require_once I didn’t touch anything else
*Now I am having troubles to see tweet json and all I get on screen is
Fatal error: Class ‘TwitterOAuth’ not found in /home/bojanarcon/public_html/twitting/get-tweets1.php on line 15
*When I change:
require_once(“twitteroauth/twitteroauth/twitteroauth.php”)
*to the one that looks to me now being the proper:
require_once(“twitteroauth_master/src/TwitterOAuth.php”); //Path to twitteroauth library
*I end up getting:
Warning: require_once(twitteroauth_master/src/TwitterOAuth.php): failed to open stream: No such file or directory in /home/bojanarcon/public_html/twitting/get-tweets1.php on line 4
Fatal error: require_once(): Failed opening required ‘twitteroauth_master/src/TwitterOAuth.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/bojanarcon/public_html/twitting/get-tweets1.php on line 4
*I have been now too long on this topic to just give up ๐
Get : {“errors”:[{“message”:”Could not authenticate you”,”code”:32}]}
———————————–
my code ;
$connection = new TwitterOAuth(‘xxx’,’xxx’,’xxx’,’xxx’);
$content = $connection->get(“account/verify_credentials”);
$statues = $connection->get(“https://api.twitter.com/1.1/statuses/show.json?id=2236985726”);
echo json_encode($statues);
————————————
at the same time, with same key and token, i can retrieve user timeline using api by j7mbo, any idea???
Hey Tom,
need help because your tutorial was when it was only twitteroauth/twitteroauth.php and twitteroauth/oauth.php, but now it is different in it https://github.com/abraham/twitteroauth . How would you do it now?
I don’t know why but I get error such as
Fatal error: Class ‘TwitterOAuth’ not found in /home/bojanarcon/public_html/test/get-tweets.php on line 14 , and I did reference it to the right place from get-tweets [removed]
I’ve been trying to get this up and running but I keep getting the following as an error message:
error: Connection problem. Check file path and www vs non-www in getJSON request
Any ideas of what’s going wrong?
Thanks!
Never mind! It was referencing the www instead of the non-www url, just like the error message said. All fixed!
Nice one Tom, this was really helpful. Thanks!
I am new to programming. I was looking at how to extract certain number of twitter feed and came across this page. I followed all the steps and tried running the script, i get error “{“errors”:[{“code”:32,”message”:”Could not authenticate you.”}]}”. I am running this from linux mint. Am I missing something? In your tutorial it says that I have to run this from the server, is the error due to running from my machine? please help.
Thank you in advance. cheers
hi Tom,
thanks for the crystal-clear tutorial. i keep coming back to this when i need to add Twitter feed functionality to sites.
i have a question though (and i’ve spent a long time looking for this): is there a way to add some pagination to this so i can implement some sort of load more/infinite scroll functionality?
ps (i’m also using a PHP function to grab instagram #search).
grateful of any help.
thanks
Leon
Hi Tom, I have the feed working however if i navigate to another page before the tweet has loaded I get an error popup, any ideas to stop this happening?
Thanks
I’m a little confused with how this works. so I made a new php file, and put in the appropriate tokens/values. I also have to download that giant file, but how do I run them or use them? where do I put the giant file in regards to this php file? I basically just want to have a text field and a button, and have the text field be the custom search, and on button click, that search returns a json of tweets ๐
I will quote Abraham from a recently raised issue on github, mentioning your tutorial here, as it seems like the tut needs some update. ๐
https://github.com/abraham/twitteroauth/issues/498
“This isn’t the correct use of the TwitterOAuth API:
$connection->get(“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=”.$twitteruser.”&count=”.$notweets);
It should conform the the examples listed on https://twitteroauth.com which would look like this:
$connection->get(“statuses/user_timeline”, [“screen_name” => $twitteruser, “count” => $notweets’);”
Hey,
I am having a problem. I created the application and am not able to figure out what server is and how to access it? I get an error Bad Data Authentication 215 when executing the python script.
Big thanks
The โtwitteroauth-master.zipโ file is missing on hyperlink โdownload the oauth files here. Update 15/01/15โ.
This was helpful. I’m now able to write something simple to keep track of my followers. Thanks
Hi Tom; Thank you for your reply.
I changed this line like this and wrote the first id of user’s tweets but i just get 20 tweets. any solution ?
$notweets = 6600842922;
——————————————————
$tweets = $connection->get(“https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=”.$twitteruser.”&since_id=”.$notweets);