Do you wish to post information remotely to your twitter account without having to write it yourself everytime? Using this php script you can send information as tweets to your twitter account.
A good example of use would be if you wished to notify your followers on twitter when you created a new blog post. To do this you could include the code below when you submit your new blog entry and have it send the title fo the blog linked to the blog page, your followers could then simply click your tweet to view the new blog content.
PHP Code:
<?php
$username = "Username Here";
$password = "Password Here";
$message = "status=This is a test post";
$url = "http://twitter.com/statuses/update.xml";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $message);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "{$username}:{$password}");
$message = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpcode != 200)
{
echo "Tweet Failed";
}
?>
The variables are pretty simple to work out what they mean so you just need to put your own values in to have it post the information as a tweet to your account.
Bookmarks