From 952bbc441047f023debf08275162dce866d04025 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 6 Dec 2005 13:56:56 +0000 Subject: my first collect-random-urls script, just for reference --- hiper/collecturls.pl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 hiper/collecturls.pl (limited to 'hiper/collecturls.pl') diff --git a/hiper/collecturls.pl b/hiper/collecturls.pl new file mode 100755 index 000000000..6a0da3686 --- /dev/null +++ b/hiper/collecturls.pl @@ -0,0 +1,34 @@ +#!/usr/bin/perl + +# 1) http://randomurl.com/body.php +# 2) http://random.yahoo.com/fast/ryl +# 3) http://www.uroulette.com/visit + +# 1) very slow, responds with URL in body meta style: +# + +# 2) Responds with non-HTTP headers like: +# Status: 301 +# Location: http://www.adaptive.net/ + +# 3) ordinary 30X code and Location: + +my $url; +map { $url .= " http://www.uroulette.com/visit"; } (1 .. 12); + +print $url."\n"; + +my $count=0; + +open(DUMP, ">>dump"); + +while(1) { + my @getit = `curl -si $url`; + for my $l (@getit) { + if($l =~ /^Location: (.*)/) { + print DUMP "$1\n"; + print STDERR "$count\r"; + $count++; + } + } +} -- cgit v1.2.3