Skip to content

Instantly share code, notes, and snippets.

@5l
Created June 29, 2018 02:38
Show Gist options
  • Save 5l/f0e50397510291de819d24a7929cf6fb to your computer and use it in GitHub Desktop.
Save 5l/f0e50397510291de819d24a7929cf6fb to your computer and use it in GitHub Desktop.
nerineri
<?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