Created
March 27, 2013 12:33
-
-
Save okumin/5253844 to your computer and use it in GitHub Desktop.
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 "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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🉐