Bitcoin Forum
April 26, 2024, 05:18:55 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [PHP] BlockExplorer Track following script  (Read 3372 times)
joepie91 (OP)
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
June 21, 2011, 04:19:07 AM
 #1

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:
<?php
/*
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                    Version 2, December 2004 

         Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

 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 <skullby@hush.com> */

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 == "<td>Received: Address</td>") {
      
$found 1;
 }

 if (
$found == && strstr($line,"<li><a href=")) {
    
preg_match('/<li><a href="\/address\/(.*)">/',$line,$matches);
    echo 
$matches[1]."\n";
    
sleep(2);
    
getNext($matches[1]);
 }


}
 
}
?>

Like my post(s)? 12TSXLa5Tu6ag4PNYCwKKSiZsaSCpAjzpu Smiley
Quote from: hawks5999
I just can't wait for fall/winter. My furnace never generated money for me before. I'll keep mining until my furnace is more profitable.
1714108735
Hero Member
*
Offline Offline

Posts: 1714108735

View Profile Personal Message (Offline)

Ignore
1714108735
Reply with quote  #2

1714108735
Report to moderator
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714108735
Hero Member
*
Offline Offline

Posts: 1714108735

View Profile Personal Message (Offline)

Ignore
1714108735
Reply with quote  #2

1714108735
Report to moderator
1714108735
Hero Member
*
Offline Offline

Posts: 1714108735

View Profile Personal Message (Offline)

Ignore
1714108735
Reply with quote  #2

1714108735
Report to moderator
1714108735
Hero Member
*
Offline Offline

Posts: 1714108735

View Profile Personal Message (Offline)

Ignore
1714108735
Reply with quote  #2

1714108735
Report to moderator
Chick
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
June 21, 2011, 05:00:08 AM
 #2

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:
<?php
/*
            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
                    Version 2, December 2004 

         Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

 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 <skullby@hush.com> */

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 == "<td>Received: Address</td>") {
      
$found 1;
 }

 if (
$found == && strstr($line,"<li><a href=")) {
    
preg_match('/<li><a href="\/address\/(.*)">/',$line,$matches);
    echo 
$matches[1]."\n";
    
sleep(2);
    
getNext($matches[1]);
 }


}
 
}
?>

Ahahahah, I shouldn't run into any problems with that license. Smiley

bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 12, 2011, 03:41:54 PM
 #3

OR
https://blockexplorer.com/q/addressfirstseen/(putaddresshere)

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
joepie91 (OP)
Sr. Member
****
Offline Offline

Activity: 294
Merit: 250


View Profile
July 12, 2011, 11:24:25 PM
 #4

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.

Like my post(s)? 12TSXLa5Tu6ag4PNYCwKKSiZsaSCpAjzpu Smiley
Quote from: hawks5999
I just can't wait for fall/winter. My furnace never generated money for me before. I'll keep mining until my furnace is more profitable.
bitlotto
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500


BitLotto - best odds + best payouts + cheat-proof


View Profile WWW
July 12, 2011, 11: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!

*Next Draw Feb 1*  BitLotto: monthly raffle (0.25 BTC per ticket) Completely transparent and impossible to manipulate who wins. TOR
TOR2WEB
Donations to: 1JQdiQsjhV2uJ4Y8HFtdqteJsZhv835a8J are appreciated.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!