开发者

Twitter API error when try to post

开发者 https://www.devze.com 2023-02-13 09:58 出处:网络
$twitteroauth = new TwitterOAuth(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, \'User_Token Access\', \'user_token secret\');
$twitteroauth = new TwitterOAuth(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET, 'User_Token Access', 'user_token secret');  

$twitteroauth->post('statuses/update', array('status' => 'Hello Nettuts+')); 

When I try to use this code, I am getting error

Could no开发者_运维技巧t authenticate you

And my Status was also not updated. Why is it so?


Regarding your comment:

I have a web app, where users' activity will be tweeted. The above tutorial works only for my twitter account

Of course you can only post tweets to your own account. Imagine what could happen if you can tweet ‘random’ messages to every account. I would not like that.

To tweet using others' accounts, you'll need their authentication keys.

0

精彩评论

暂无评论...
验证码 换一张
取 消