简体   繁体   English

twitter 使用 php 和 twitter 通过机器人更新状态消息 oauth

[英]twitter status message update through bot using php and twitter oauth

I have followed the steps defined in the following link for twitter oauth implementation.我已按照以下链接中定义的步骤执行 twitter oauth 实施。

https://docs.google.com/View?docID=dcf2dzzs_2339fzbfsf4 https://docs.google.com/View?docID=dcf2dzzs_2339fzbfsf4

Its working fine when i run through web browser but i want a user should be able to update status of twitter account through gmail chat ie he should only be authenticated once through web then he should be able to send the status message through gmail chat and his twitter account should be updated当我通过 web 浏览器运行时它工作正常,但我希望用户应该能够通过 gmail 聊天更新 twitter 帐户的状态,即他应该只通过 web 进行一次身份验证,然后他应该能够通过 gmail 聊天和他的发送状态消息twitter 帐号应更新

How can i inegrate this because gmail id can be different from twitter id?我怎么能集成这个因为 gmail id 可以不同于 twitter id?

Please guide.请指导。

When you authenticate with twitter using oauth your given credentials you can store and use later when posting updates.当您使用 oauth 对 twitter 进行身份验证时,您可以存储并在以后发布更新时使用给定的凭据。

Try using this library,尝试使用这个库,

http://emmense.com/php-twitter/ http://emmense.com/php-twitter/

Cheers干杯

This might be help, I also face the same issue before, and it is now solved.这个可能有用,我之前也遇到过同样的问题,现在已经解决了。

http://ruckuus.wordpress.com/2009/09/04/pecl-and-twitter-oauth/ http://ruckuus.wordpress.com/2009/09/04/pecl-and-twitter-oauth/

Basically, after you ask a grant from user, then you access /access_token you will get authenticated oauth_token, and oauth_token_secret which is persistent.基本上,在您请求用户授权后,然后您访问 /access_token,您将获得经过身份验证的 oauth_token 和持久的 oauth_token_secret。 so further on you don't need access to access_token anymore if you already had these variables.所以如果你已经有了这些变量,你就不再需要访问 access_token 了。

Storing it is very simple, either to put them in database, cookies (if you use web application) or in a plaintext.存储起来非常简单,要么将它们放入数据库 cookies(如果您使用 web 应用程序),要么将其放入明文。

This article had everything I needed to set up a Twitter-posting bot that authenticates with OAuth: http://masnun.com/blog/2010/04/30/setting-up-twitter-bots-with-oauth/这篇文章包含了我设置一个使用 OAuth 进行身份验证的 Twitter 发布机器人所需的一切: http://masnun.com/blog/2010/04/30/setting-up-twitter-bots-with-oauth/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM