Skip to content

Instantly share code, notes, and snippets.

@rajadain
Created December 9, 2012 05:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rajadain/4243517 to your computer and use it in GitHub Desktop.
Save rajadain/4243517 to your computer and use it in GitHub Desktop.
Finding Short Twitter Handles
<?php
for ($i = 97; $i < 122; $i++) {
for ($j = 0; $j < 100; $j++) {
$usn = chr($i) . strval($j);
$url="http://api.twitter.com/1/users/show.json?screen_name=".$usn;
$json = file_get_contents($url,0,null,null);
if ($http_response_header[0] == "HTTP/1.1 404 Not Found ")
echo "<p style='color:red'>$usn is available.</p>";
else
echo "<p style='color:grey'>$usn is not available.</p> ";
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment