发布到多个 Twitter 帐户 PHP [英] Post to multiple twitter accounts 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: https://github.com/themattharris/tmhOAuth
1.
PHP Class: https://github.com/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.
https://dev.twitter.com/apps/new(注册一个应用,获取每个账户的密钥)
3.
https://dev.twitter.com/apps/new (register an app, get keys foreach account)
4.
tweet("yay!", ...);
5.
转到 4 但使用不同的键
5.
goto 4 but with different keys
这篇关于发布到多个 Twitter 帐户 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!