// require twitteroauth
require_once('twitteroauth/twitteroauth.php');
// Twitter API bilgileri
$consumerKey = 'key';
$consumerSecret = 'seccret';
$accessToken = 'user-keyword';
$accessTokenSecret = 'user-secret';
function randomline ( $twee );
$lines = file( $twee );
return $lines[array_rand( $lines )];
}
$twee = randomline('tw.txt');
$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);
// Yüz kırk karakter izni.
if(strlen($twee) <= 140) {
// Tweet gönderme işlemi.
$tweet->post('statuses/update', array('status' => $twee));
}
?>TwitterOAuth dosyasını twitteroauth github abraham yazarak google'den indirebilirsiniz.
Bir tweet.php adı altında bir dosya açın ve FTP ye gönderin. twitteroauth/twitteroauth.php dosyalarını da FTP ye aynı dizine gönderin,
tw.txt adlı bir txt dosyası açıp atılacak tweetleri yazın kayıt edin ve FTP ye gönderin.
Cronjob ayarlarını yapmayı unutmayın.
Bir adet Like ve +R10'u çok görmeyin :P
Kendim bizzat kullanmış olduğum basit bir PHP kod yığmasıdır.