diff options
author | Marius Halden <marius.h@lden.org> | 2015-02-14 06:37:32 +0100 |
---|---|---|
committer | Marius Halden <marius.h@lden.org> | 2015-02-14 06:37:32 +0100 |
commit | 7fcdc94b87fcacc400329aa1461e455c50b30642 (patch) | |
tree | 0d3f24ade7a56ed314c8afb6bd72c789984561f4 | |
parent | 9dfe9abad6592a8b09361c4ea572b220272fd7d6 (diff) | |
download | appdrift-stats-7fcdc94b87fcacc400329aa1461e455c50b30642.tar.gz appdrift-stats-7fcdc94b87fcacc400329aa1461e455c50b30642.tar.bz2 appdrift-stats-7fcdc94b87fcacc400329aa1461e455c50b30642.tar.xz |
adjusted for running on vm in actual network
-rwxr-xr-x | stats.pl | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -9,7 +9,7 @@ use RRD::Simple (); use LWP::UserAgent; use LWP::Protocol::socks; -my $rrd_path = "/home/marius/appdrift"; +my $rrd_path = "/appdrift"; my $score_url = "http://128.39.121.4/purser/scoreboard.txt"; my @group_colors = qw( @@ -19,18 +19,6 @@ my @group_colors = qw( 000066 3366CC CC00CC 800000 CC0099 ); -# HTTP get from url through proxy -sub proxy_get { - my $remote = shift; - - my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5'); - $ua->proxy([ qw(http https) ] => 'socks://localhost:9090'); - - my $response = $ua->get($remote); - - return $response->content; -} - # Check if string is in array sub in_array { my $str = shift; @@ -88,7 +76,7 @@ $#group_colors = $#group_names; for my $group (@group_names) { my ($users, $posts, $comments) = (undef); - my $content = proxy_get("http://".$group_info->{'server'}->{$group}); + my $content = get("http://".$group_info->{'server'}->{$group}); for my $line (split /\n/, $content) { last if (defined($users) && defined($posts) && defined($comments)); |