[twitter-dev] Re: Twitter OAuth 401 Unauthorized
This code helped me understand the OAuth flow and it written in PHP with no libraries. https://github.com/joechung/oauth_twitter See the authors blog post about it here http://nullinfo.wordpress.com/oauth-twitter/ On Mar 10, 5:55 am, Tudor Claudiu Florea tudor.claudiu.flo...@gmail.com wrote: Hello, I am trying to build an application for twitter and in order to do that i need to build functions that post all requests to twitter only with pure PHP. no OAuth libraries or other user build libraries. problem is i always get the 401 unauthorized header. I have done twitter tutorial about this with theyr values(keys) and got same signature base and signature and everything else but when i input my data(secret key and stuff) all i get is 401 unauthorized This is a sample of my sent/received headers POST /oauth/request_token HTTP/1.1 Host:api.twitter.com:443 Content-Type: application/x-www-form-urlencoded Authorization:OAuth oauth_callback=http%3A%2F%2Fadme.ro %2Ftwitter_request.php,oauth_consumer_key=xxx..xxx,oauth_nonce=12997527 12,oauth_signature_method=HMAC- SHA1,oauth_timestamp=1299752712,oauth_version=1.0,signature=Mv2IRkcgC p3BNocBKFq8FJNN1OE %3D HTTP/1.1 401 Unauthorized Date: Thu, 10 Mar 2011 10:25:18 GMT Server: hi Status: 401 Unauthorized X-Transaction: 1299752718-94070-29343 Last-Modified: Thu, 10 Mar 2011 10:25:18 GMT X-Runtime: 0.00653 Content-Type: text/html; charset=utf-8 Content-Length: 44 Pragma: no-cache X-Revision: DEV Expires: Tue, 31 Mar 1981 05:00:00 GMT Cache-Control: no-cache, no-store, must-revalidate, pre-check=0, post- check=0 Set-Cookie: k=93.114.42.59.1299752718223070; path=/; expires=Thu, 17- Mar-11 10:25:18 GMT; domain=.twitter.com Set-Cookie: guest_id=129975271823092185; path=/; expires=Sat, 09 Apr 2011 10:25:18 GMT Set-Cookie: _twitter_sess=BAh7CDoPY3JlYXRlZF9hdGwrCJePTJ8uAToHaWQiJTYwOGViZTRmYjYzY2Rm %250AYTI5NjM3NDRmZTNkODIwODg3IgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVy %250AOjpGbGFzaDo6Rmxhc2hIYXNoewAGOgpAdXNlZHsA-- c237f0c52f06bd5e58f547db67136857e092fa2f; domain=.twitter.com; path=/; HttpOnly Vary: Accept-Encoding Connection: close Failed to validate oauth signature and token Can someone help me with this? i ran out of ideeas ... -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk
[twitter-dev] Re: Is includes_rts=true for statuses/mentions broken?
I figured out why I was not seeing native retweets being included in my results. I was calling api.twitter.com/statuses/user_timeline, but should have been calling api.twitter.com/1/statuses/user_timeline. Adding the 1/ for the api version made the difference. Perhaps that is the cause of Anil's problem as well. On Feb 10, 2:06 am, Abraham Williams 4bra...@gmail.com wrote: I think you have the wrong idea of what include_rts does. Include_rts is designed to include native retweets in timelines where default inclusion would break. For example /statuses/user_timeline expects all tweets to be from a user A. But if that user A has retweeted user B then user Bs tweets can be included user As user_timeline with include_rts. Include_rts has no effect on /statuses/mentions because the original tweet is already included due to the fact it is a mention. Abraham - Abraham Williams | Hacker Advocate | abrah.am @abraham https://twitter.com/abraham | github.com/abraham | blog.abrah.am This email is: [ ] shareable [x] ask first [ ] private.On Wed, Feb 9, 2011 at 21:00, Adam Duke adam.v.d...@gmail.com wrote: I've seen the same behavior with the include_rts parameter. I have tried passing the values 'true', 't', and '1' with no success. On Feb 8, 7:15 pm, Anil Chawla ani...@gmail.com wrote: It's been a while but I want to follow up on this because we still have the issue. Is anyone able to pull native retweets when calling the statuses/mentions endpoint? An indication that includes_rts either works for you or doesn't work would be great. Thanks, -Anil On Dec 14 2010, 11:44 am, Anil Chawla ani...@gmail.com wrote: I've also been facing this issue for quite a long time. I've told myself that this can't be a problem with the API (since nobody else is complaining) but I can't see what is wrong on our end. For example, I have the following status that was retweeted a few times: http://twitter.com/#!/anilchawla/status/14437959797313536 This is the request URL that is generated when I request my mentions using count=200, include_rts=true, and since_id = 13978625736970241 (OAuth tokens omitted): https://api.twitter.com/1/statuses/mentions.json?count=200include_rt... The four mentions of the above status are not present in the response even though those retweets and the original status have an ID greater than since_id. Omitting count and since_id does not make a difference. As a work-around, we have to pull both statuses/mentions and statuses/retweets_of_me and merge them together. It's hard to believe that everyone else has been doing the same and ignoring this API parameter. Any idea what the issue is? -Anil -- Twitter developer documentation and resources:http://dev.twitter.com/doc API updates via Twitter:http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk
[twitter-dev] Re: Is includes_rts=true for statuses/mentions broken?
I've seen the same behavior with the include_rts parameter. I have tried passing the values 'true', 't', and '1' with no success. On Feb 8, 7:15 pm, Anil Chawla ani...@gmail.com wrote: It's been a while but I want to follow up on this because we still have the issue. Is anyone able to pull native retweets when calling the statuses/mentions endpoint? An indication that includes_rts either works for you or doesn't work would be great. Thanks, -Anil On Dec 14 2010, 11:44 am, Anil Chawla ani...@gmail.com wrote: I've also been facing this issue for quite a long time. I've told myself that this can't be a problem with the API (since nobody else is complaining) but I can't see what is wrong on our end. For example, I have the following status that was retweeted a few times: http://twitter.com/#!/anilchawla/status/14437959797313536 This is the request URL that is generated when I request my mentions using count=200, include_rts=true, and since_id = 13978625736970241 (OAuth tokens omitted):https://api.twitter.com/1/statuses/mentions.json?count=200include_rt... The four mentions of the above status are not present in the response even though those retweets and the original status have an ID greater than since_id. Omitting count and since_id does not make a difference. As a work-around, we have to pull both statuses/mentions and statuses/retweets_of_me and merge them together. It's hard to believe that everyone else has been doing the same and ignoring this API parameter. Any idea what the issue is? -Anil -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk
[twitter-dev] Re: in_reply_to_status_id
I was working with this api method today as well. What I found was that if your update's text does not contain an @reply to the user who created the status you are sending a reply to, Twitter seems to ignore the in_reply_to_status_id. I hope that helps. -Adam On Jan 28, 10:11 am, Rocker shadab.empo...@gmail.com wrote: Hi all, I am trying to achieve the reply functionality of the twitter to a particular tweet(status) using thehttp://api.twitter.com/version/statuses/update.formaturl. In this i am passing in_reply_to_status_id parameter and include_entities=true to replay to a tweet. The status got updated but the response xml doesn't contain any data in the in_reply_to_status_id node. Even though the status got posted, it isn't displayed as a reply. Am i on the wrong track? What could be the possible reason. I am using OAuth for the whole scenario. Thanks Rocker -- Twitter developer documentation and resources: http://dev.twitter.com/doc API updates via Twitter: http://twitter.com/twitterapi Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list Change your membership to this group: http://groups.google.com/group/twitter-development-talk