cURL & php ile twitter’a otomatik yazı gönderme
Kategori: Kodlama


(No Ratings Yet)

Loading ...
3 Yorum

PHP:
-
$twitter_api_url = "http://twitter.com/statuses/update.xml";
-
$twitter_data = "status=Buraya Link ve Açıklama Yazabilirsiniz";
-
$twitter_user = "KullaniciAdi";
-
$twitter_password = "Sifre";
-
$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);
-
if ($httpcode != 200) {
-
-
} else {
-
-
}
Yapmanız gereken cURL destekleyen bir sunucunuz var ise istediğiniz makale veya yazılarınızı otomatik olarak twitter hesabınıza post etmenize yardımcı olur.
Kolay Gelsin
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
17:49
Merhabalar Osman bey ,
Mesela ben a.xml dosyasında yi cekiyorum. Ama sitenin title’si gelir oysa ben Konuları çekmek istiyorum nasıl yapabilirim ?
Şimdiden teşekkürler