Net::Tor::Servers - Perl extension to query a Tor Directory and collect information on servers
use Net::Tor::Servers; my $torsrv = new Net::Tor::Servers; my @servers = $torsrv->getservers; for my $i (0..$#servers) { print "IP: $servers[$i][0], Name: $servers[$i][1], ORPort: $servers[$i][2], DirPort: $servers[$i][3]"; if ($servers[$i][4]==1) { print " (Exit Node)\n"; } else { print " (relay node)\n"; } }
This module was written to make life a little easier for me when I have been developing a dymanic blocklist for educational institutions to prevent students from being able to circumvent legally required content filtering systems.
Its nothing special, just a quick and easy way to get the data together in an array.
An alternative server and port can be specified:
my @servers = $torsrv->getservers($server,$port); where $server is the IP / hostname of a Tor Directory Server, and $port is the port number.
N/A
Andy Dixon, <ajdixon@cpan.org> www.andydixon.com
Copyright (C) 2011 by Andy Dixon
Thanks to Folkert van Heusden <a href='http://www.vanheusden.com'>www.vanheusden.com</a> for tor node type request and subsequent code change.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
To install Net::Tor::Servers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Tor::Servers
CPAN shell
perl -MCPAN -e shell install Net::Tor::Servers
For more information on module installation, please visit the detailed CPAN module installation guide.