Skip to content

@banthar /servers.pl
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
#!/usr/bin/perl
use DBI;
use LWP::Simple;
my $dbh = DBI->connect("dbi:SQLite:dbname=servers.sqlite3","","");
{
my $sth = $dbh->prepare("CREATE TABLE servertypes (name varchar(255));");
if(defined $sth)
{
$sth->execute();
}
}
my @hosts=("http://google.com","http://reddit.com","http://digg.com");
foreach( @hosts)
{
my $host=$_;
print "Checking $host ...\n";
my $type=head($host)->server."\n";
my $sth=$dbh->prepare("INSERT INTO servertypes VALUES ('$type');");
$sth->execute();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.