使用 Twitter OAuth 进行自动状态更新 [英] Using Twitter OAuth for automatic status update
问题描述
我希望我的网站使用 PHP 中的 OAuth 自动将状态更新发布到特定的 Twitter 帐户.
I want my website to automatically post status updates to a particular twitter account using OAuth in PHP.
我使用 URL 进行测试
I test this using a URL
www.mysite.com/update_status
www.mysite.com/update_status
但它要求我输入用户名"和密码",这在我测试时很好.但是在发布状态更新之前,我的网站将无法插入此用户名和密码.
but it asks me for "user name" and "password", which is fine when I am testing it. But my website will not be able to insert this user name and password before posting the status update.
所以问题是服务器中的网站如何在不填写用户名和密码的情况下自动向帐户发布状态更新.
So the question is how can a website which is in the server, automatically post a status update to an account without user filling out the user name and password.
有没有办法绕过这个?我尝试保存 oAuth 令牌,但没有用.
Is there any way to bypass this? I tried saving oAuth tokens, but it's not working.
提前感谢您的回答!
推荐答案
我的建议:
1) 使用像 http://github.com/abraham/twitteroauth 这样的 PHP 库.
1) Use a PHP library like http://github.com/abraham/twitteroauth.
2) 在 http://dev.twitter.com/apps 上选择您的应用并点击在我的访问令牌"上.
2) Select your app on http://dev.twitter.com/apps and click on "My Access Token".
3) 我们在 http://dev.twitter.com/pages/中描述的访问令牌oauth_single_token.
这篇关于使用 Twitter OAuth 进行自动状态更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!