本文介绍了发布到多个 Twitter 帐户 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经阅读了许多关于使用 OAuth 发布到 Twitter 的教程,例如 这里 但我对某些事情仍然不清楚.
i HAVE read many Tutorials on posting to twitter using OAuth like here but i am still unclear on some things.
我的要求是通过我有用户名/密码的多个帐户发送推文.
这可能吗?如果是,那么我该怎么做?我很困惑如何获取我拥有的每个用户帐户所需的 4secret 密钥.
Is this possible ? If yes then how do i do it? I am confused how to get the 4secret keys required for each user account that i have.
推荐答案1. PHP Class: github/themattharris/tmhOAuth
1. PHP Class: github/themattharris/tmhOAuth
2. PHP 函数
function tweet($status, $consumer_key, $consumer_secret, $user_token, $user_secret){ include("class.twitter.php"); $tmhOAuth = new tmhOAuth(array( 'consumer_key'=> $consumer_key, 'consumer_secret' => $consumer_secret, 'user_token' => $user_token, 'user_secret' => $user_secret, )); $tmhOAuth->request('POST', $tmhOAuth->url('1/statuses/update'), array( 'status' => $status )); }3. dev.twitter/apps/new(注册一个应用,获取每个账户的密钥)
3. dev.twitter/apps/new (register an app, get keys foreach account)
4. tweet("yay!", ...);
5. 转到 4 但使用不同的键
5. goto 4 but with different keys
更多推荐
发布到多个 Twitter 帐户 PHP
发布评论