A day in the life of an audio visual junkie
28 Oct
I’m now using Twitter Updater by Victoria Chan
Okay I had to edit the Plugin to get it to work. Here is what I did:
function vc_doTwitterAPIPost($twit, $twitterURI) {
//check if user login details have been entered on admin page
$thisLoginDetails = get_option(’twitterlogin_encrypted’);
if($thisLoginDetails != ”)
{
//this code based on http://www.morethanseven.net/posts/posting-to-twitter-using-php/
//
list($username,$password) = split(”:”,base64_decode($thisLoginDetails));
$url = ‘http://twitter.com/statuses/update.xml’;
$curl_handle = curl_init();
curl_setopt($curl_handle, CURLOPT_URL, “$url”);
curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl_handle, CURLOPT_POST, 1);
curl_setopt($curl_handle, CURLOPT_POSTFIELDS, “$twit”);
curl_setopt($curl_handle, CURLOPT_USERPWD, “$username:$password”);
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
return ”;
} else {
//user has not entered details.. Do nothing? Don’t wanna mess up the post saving..
return ”;
}
}
I got the solution from James Cridland’s blog
Leave a reply