-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomometer
More file actions
executable file
·35 lines (29 loc) · 874 Bytes
/
homometer
File metadata and controls
executable file
·35 lines (29 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env perl
# Copyright (c) Maximilian Gaß <mxey@cloudconnected.org>
# License: WTFPL
use strict;
use warnings;
use LWP::UserAgent;
if (!scalar(@ARGV)) {
print STDERR "Usage: $0 name [name ...]\n";
exit 1;
}
my $ua = new LWP::UserAgent;
for my $nick (@ARGV) {
my $req = new HTTP::Request(POST => "http://www.bongster.de/scripte/schwulometer.pl");
$req->content_type("application/x-www-form-urlencoded");
$req->content("nick=$nick");
$req->header(Referer => "http://www.bongster.de/scripte/schwulometer.pl");
my $res = $ua->request($req);
if (!$res->is_success) {
die("Could not get site: $res->status_line - dying");
}
if ($res->content =~ m#<b>([0-9]{1,2},[0-9]{1,2}%)</b>#m) {
if (@ARGV > 1) {
print "$nick:\t";
}
print "$1\n";
} else {
print STDERR "Could not find percent\n";
}
}