Created
February 12, 2015 17:56
-
-
Save anonymous/3a9dbd180bde3ce4735f 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 | |
set_time_limit(0); | |
$mangoes = array(); | |
do_log_blockchain(); | |
function do_log_blockchain(){ | |
global $mangoes; | |
$path = getcwd(). "/mango_blockchain.txt"; | |
if(!file_exists($path)){ | |
file_put_contents($path, ""); | |
} | |
$mangoes = file($path); | |
$mangoes = array_map("strtolower", $mangoes); | |
$mangoes = array_unique($mangoes); | |
sort($mangoes, SORT_STRING); | |
while(1) { | |
printf("Parsing data... \n"); | |
// match user + balance /Sync\\:\s(.*?)\samount\s(\d+(.|,))+(\d)/ | |
// Sync\\:\s(.*?)[+-]?((\d+(\.\d*)?)|(\.\d+))\sMCZ/ | |
preg_match_all("/Sync\\:\s(.*?)[+-]?((\d+(\.\d*)?)|(\.\d+))\sMCZ/", strip_tags(file_get_contents('http://www.mangocoinz.com/blockchain')), $users); | |
foreach ($users[0] as $usr) { | |
if(!in_array($usr, $mangoes)){ | |
printf("[!] %s\n", $usr); | |
write_out($usr, "mango_blockchain.txt"); | |
array_push($mangoes, print_r($usr, true)); | |
} | |
} | |
//print_r(array_unique($mangoes)); | |
$mangoes = array_unique($mangoes); | |
printf("currently %s users\n", sizeof($mangoes)); | |
foreach ($mangoes as $usr) { | |
//send_coins($usr); | |
} | |
sleep(60); | |
} | |
} | |
function write_out($str, $path){ | |
$lin = file($path); | |
$lin = array_map("strtolower", $lin); | |
$lin = array_unique($lin); | |
sort($lin, SORT_STRING); | |
$mangoes = $lin; | |
file_put_contents($path, implode('', $lin)); | |
if($h = fopen($path, 'a')){ | |
fwrite($h, "$str\n"); | |
} | |
fclose($h); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment