¿Cómo puedo twittear en Twitter desde mi sitio web? Estoy usando un script PHP. Cualquier tweet que envíe desde mi sitio web debería actualizar mi cuenta de Twitter. Yo uso el siguiente código, pero no se actualiza en mi cuenta de twitter:Cómo hacer un Tweet en Twitter usando PHP
// Set username and password
$username='myusername';
$password='*********';
// The message you want to send
$message = 'Nice to c all again.Have a nice day..';
// The twitter API address
$url='http://twitter.com/statuses/update.xml';
// Alternative JSON version
// $url = 'http://twitter.com/statuses/update.json';
// Set up and execute the curl process
$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,"status=".$message);
curl_setopt($curl_handle, CURLOPT_USERPWD,"$username:$password");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);
// check for success or failure
if (empty($buffer)) {
echo 'Try again';
} else {
echo 'success';
}
Este script devuelve un mensaje de éxito, pero cuando reviso mi cuenta de Twitter no se encuentran los tweets.
¿Cuál podría ser el problema?
Un google usando palabras clave como 'twitter php' arrojaría muchos enlaces. Algunos enlaces útiles son: http://dev.twitter.com/pages/libraries#php http://code.google.com/p/php-twitter/ Aún no ha agregado su script. – thotheolh