Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * @author xkatonsurya
- * 23 Jul 2014 06:39 AM
- * ganti header ini tak cipok ntar
- */
- require_once('twitteroauth/twitteroauth.php');
- function RandomLine($filename){
- $lines = file($filename);
- return $lines[array_rand($lines)];
- }
- // settings tw app for web
- define('CONSUMER_KEY', 'ISI_CONSUMER_KEY_DISINI');
- define('CONSUMER_SECRET', 'ISI_CONSUMER_SECRET_DISINI');
- $oauth_token = "ISI_AKSES_TOKEN";
- $oauth_token_secret = "ISI_AKSES_SECRET";
- echo "[+] Memulai ...\n\n";
- $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET, $oauth_token, $oauth_token_secret);
- $dapatkan = $connection->get('search/tweets', array('q'=>'#KatonSuryaA', 'result_type'=>'recent', 'count'=>'2')); // result_type bisa dilait di docs api twitter // pakein count biar lebih dari 15 atau kurang dari 15
- foreach ($dapatkan->statuses as $no => $value) {
- $id_str = $value->id_str;
- $text = $value->text;
- $screen_name = $value->user->screen_name;
- $random = RandomLine("spam.txt");
- $update = $connection->post('statuses/update', array('in_reply_to_status_id' => ''.$id_str.'', 'status'=>'@'.$screen_name.' '.$random.''));
- echo "".$id_str."|| ".$text." || ".$screen_name."\n";
- if(!empty($post->errors)){
- echo "Gagal Membalas...\n\n";
- }else{
- echo "Sukses Membalas...\n\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement