Created
December 30, 2013 17:00
-
-
Save Plastix/8184735 to your computer and use it in GitHub Desktop.
PHP script used for checking the availability of Minecraft usernames. Requires a text file called names.txt in the same directory as the script with one name per line. Available names are saved to available_names.txt.
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 | |
// Checks the availability of Minecraft usernames given a text file of names | |
$names = Array(); | |
$input = "./names.txt"; //Names to be checked (one per line) | |
$output= "./available_names.txt"; //Available names | |
$names = file($input, FILE_IGNORE_NEW_LINES); | |
if(file_exists($output)) file_put_contents($output, ""); | |
foreach( $names as $name ) { | |
$response = file_get_contents('https://account.minecraft.net/buy/frame/checkName/' . $name); | |
echo $response . " - " . $name . "\n"; | |
if($response == "OK") file_put_contents($output, $name . "\n", FILE_APPEND | LOCK_EX); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment