Author

Topic: [PHP] BlockExplorer Track following script (Read 3399 times)

hero member
Activity: 672
Merit: 500
BitLotto - best odds + best payouts + cheat-proof
July 12, 2011, 06:29:51 PM
#5
Um, no.

This script traces back an address, to find where a specific transaction originated (in this case someone was branching off 0.04 every time and who wrote it wanted to figure out where that originated).

What you linked just gives the first seen date for a specific address (aka the first transaction).

Entirely different things.
ohhhh I mis-read what it does.  Embarrassed Cool!
sr. member
Activity: 294
Merit: 250
Um, no.

This script traces back an address, to find where a specific transaction originated (in this case someone was branching off 0.04 every time and who wrote it wanted to figure out where that originated).

What you linked just gives the first seen date for a specific address (aka the first transaction).

Entirely different things.
hero member
Activity: 672
Merit: 500
BitLotto - best odds + best payouts + cheat-proof
member
Activity: 70
Merit: 10
sr. member
Activity: 294
Merit: 250
Posting this for a friend... he does not have sufficient posts to post in here yet.

It basically searches back through the blockchain (using Block Explorer) to find the earliest trace of an address (by following the first address link on every page).

Code:
/*
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                    Version 2, December 2004 

         Copyright (C) 2004 Sam Hocevar 

 Everyone is permitted to copy and distribute verbatim or modified 
 copies of this license document, and changing it is allowed as long 
 as the name is changed. 

            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 

  0. You just DO WHAT THE FUCK YOU WANT TO. 
*/

/* This program is free software. It comes without any warranty, to
 * the extent permitted by applicable law. You can redistribute it
 * and/or modify it under the terms of the Do What The Fuck You Want
 * To Public License, Version 2, as published by Sam Hocevar. See
 * http://sam.zoy.org/wtfpl/COPYING for more details. */

/* Questions? ask Skullby  */

error_reporting(0);
ini_set('display_errors','Off');

//$startHash = "166inTrZD3G9SMKRcsaRnvFcCbeSrKoyxL"; 
$startHash "18ukPi1oAcLau91YfpTkXY1EuZrYxZyUBx"// a hash I found, and wanted to trace backward in time. :)

getNext($startHash);

function 
getNext($hash) {
if (
$hash == "") {
  echo 
"\ndone\n";
  die;
}
$handle fopen("http://blockexplorer.com/address/".$hash,"r");
$contents ''
while (!
feof($handle)) {
  
$contents .= fread($handle8192);
}
fclose($handle);

$lines split("\n",$contents);

foreach (
$lines as $key=>$line) {
 if (
$line == "Received: Address") {
      
$found 1;
 }

 if (
$found == && strstr($line,"
  • )) {
        
    preg_match('/
  • /',$line,$matches);
        echo 
    $matches[1]."\n";
        
    sleep(2);
        
    getNext($matches[1]);
     }


    }
     
    }
    ?>
  • Jump to: