.

LORDDAdıgüzelAvatar
Yazan:drekon

Twitter sitesine girmeden php ile mesaj göndermek:

$user = "isminiz";
$pass = "şifre";
$mesaj = "Php ile twittere gidecek mesaj";
$url = "http://twitter.com/statuses/update.xml";


$mesaj=mb_convert_encoding($mesaj,"UTF-8","ISO-8859-9");
//Bu ilk satır Türkçe harfler için, bu satır olmadan da çalışır


$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=$mesaj");
curl_setopt($curl_handle, CURLOPT_USERPWD, "$user:$pass");
$buffer = curl_exec($curl_handle);
curl_close($curl_handle);

if (empty($buffer)) {
    echo ´hata´;
} else {
    echo ´tamam´;
}

hocam bu şu an tamam diyor ama çalışmıyor :((

2013-03-15 16:27:59

phpkodlari.com © 2009 Herkes Php öğrenecek
Eglence ve Oyun: Gamikro