Created
June 29, 2018 02:38
-
-
Save 5l/f0e50397510291de819d24a7929cf6fb to your computer and use it in GitHub Desktop.
nerineri
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
# 無限リツイート | |
require_once("TwistOAuth.php"); | |
$id = "xxx"; | |
$pw = "xxx"; | |
$target = "1012259308753637376"; | |
# ログイン | |
try{ | |
$to = TwistOAuth::login( | |
'ck', | |
'cs', | |
$id, | |
$pw | |
); | |
}catch(TwistException $e){ | |
e($e->getMessage()); | |
die(); | |
} | |
# リツイート | |
while(true){ | |
$now_id = false; | |
try{ | |
$res = $to->post("statuses/retweet/" . $target); | |
e("Retweet {$target}"); | |
}catch(TwistException $e){ | |
e($e->getMessage()); | |
break; | |
} | |
$now_id = $res->id_str; | |
if($now_id){ | |
try{ | |
$res = $to->post("statuses/destroy/" . $now_id); | |
e("Delete {$now_id}"); | |
}catch(TwistException $e){ | |
e($e->getMessage()); | |
break; | |
} | |
} | |
} | |
function e($str){ | |
echo mb_convert_encoding($str.PHP_EOL, "SJIS", "auto"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment