Created
August 2, 2018 14:03
-
-
Save allenday/68d4b283ffcc3874121c785f257d26a4 to your computer and use it in GitHub Desktop.
scrape method signatures for ethereum from 4byte.directory
This file contains hidden or 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
#!/usr/bin/perl | |
use strict; | |
use LWP::Simple qw(get); | |
my $p = 1; | |
while ( 1 ) { | |
my $response = get(qq(https://www.4byte.directory/signatures/?page=$p)); | |
while ( $response =~ m#\G.+?<td class="text_signature">(\S+)</td>\s*<td class="bytes_signature"><code>(\w{10})</code></td>#gs ) { | |
my $txt = $1; | |
my $sig = $2; | |
print "$sig\t$txt\n"; | |
} | |
if ( $response !~ m/aria-label="Next"/s ) { | |
last; | |
} | |
$p++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment