Feb 22
FORM HTML
FILE PHP
$data = $_POST[‘tweet-msg’];
$twitter_data = "status=" . substr($data, 0, 136) ." …";
$twitter_user = ‘tuauser’;
$twitter_password = ‘tuapassword’;
$twitter_api_url = "http://twitter.com/statuses/update.xml";
$ch = curl_init($twitter_api_url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $twitter_data);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, "{$twitter_user}:{$twitter_password}");
$twitter_data = curl_exec($ch);
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
fonte: www.sastgroup.com » Vai al post originale