Skip to content

Instantly share code, notes, and snippets.

@okumin
Created March 27, 2013 12:33
Show Gist options
  • Save okumin/5253844 to your computer and use it in GitHub Desktop.
Save okumin/5253844 to your computer and use it in GitHub Desktop.
<?php
require_once "twitteroauth/twitteroauth/twitteroauth.php";
$client = new TwitterOauth(CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, ACCESS_TOKEN_SECRET);
$next_cursor = -1;
$target = "";
$f = fopen("./hogehoge.txt", "w");
while($next_cursor != 0) {
for($i = 0 ; $i < 5; $i++) {
# TODO: rate limit
$res = $client->get("followers/ids", array("screen_name" => $target, "cursor" => $next_cursor));
if (!isset($res->errors)) {
break;
}
var_dump($res->errors[0]->message);
}
$v = implode("\n", $res->ids);
$v .= "\n";
fwrite($f, $v);
$next_cursor = $res->next_cursor_str;
}
fclose($f);
@alea12
Copy link

alea12 commented Mar 28, 2013

🉐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment