2014-05-06 106 views
0
<? 
// here we want to send the article to twitter 
require_once('twitteroauth.php'); 
// Twitter Connection Data 
$tConsumerKey       = 'xxxx'; 
$tConsumerSecret    = 'xxxx'; 
$tAccessToken       = 'xxxx'; 
$tAccessTokenSecret = 'xxxx'; 
// start connection 
$tweet = new TwitterOAuth($tConsumerKey, $tConsumerSecret, $tAccessToken, $tAccessTokenSecret); 
// the message 
$message = 'Auto Tweet via PHP ...'; 
// send to twitter 
$tweet->post('statuses/update', array('status' => $message)); 
?> 

这是我的代码..它不发送帖子推文。是关于localhost还是别的? 我在Windows7上使用xampp ..Twitter不与本地主机连接PHP

回答

0

您使用哪个库进行OAuth?它是为你制作的应用程序还是别人的?

如果您可以编辑并检查Twitter开发人员区域的设置,那么在对您的应用程序进行身份验证时,有关使用localhost与您的twitter应用程序的问题可能对您的回调有用。

Twitter oAuth callbackUrl - localhost development

我发现它有用希望在开发过程中的应用程序连接的时候。使用127.0.0.1。