All pastes #1251328 Raw Edit

ETS Valid Stems Script

public text v1 · immutable
#1251328 ·published 2008-11-11 00:22 UTC
rendered paste body
----- ETS shell script, CUT HERE : -----
#!/bin/sh

if [ $# -lt 2 ]; then
    echo "Usage: $0 <firstpage> <lastpage>"
    exit 1
fi


start=$1
last=$2

page=$start
while [ $page -le $last ];
do
    offset=`expr \( $page - 1 \) \* 20`
    base="http://www.echoingthesound.org/phpbbx/viewtopic.php?t=29040&postdays=0&postorder=asc&start=$offset&sid=78254cc685f02a08f10c1341f64812f5"
    echo "Page: $page (offset=$offset)"
    for u in ` lynx -dump "$base" | xurl`
    do
        url=`echo "$u" | sed -e 's,h..p://,http://,'`
        case $url in
          *rapid*)      grep="grep /files/";;
          *mediafire*)  grep="grep -i Requested:";;
          *megaupload*) grep="grep -i Filename:";;
          *sendspace*)  grep="grep -i Name:";;
          *) grep=skip;;
        esac
        if [ ! "$grep" = skip ]; then
            x=`lynx -dump $url | $grep`
            if [ ! "x$x" = x ]; then
                echo "$url : $x"
            fi
        fi
    done
    page=`expr $page + 1`
done
----- END SCRIPT -----
---- xurl script CUT HERE -----
#!/usr/pkg/bin/perl
# replace the above line with your path to perl
$full=0;

if ($ARGV[0] eq "-f") {
    $full=1;
    shift;
}

while (<>) {
chomp;

$REGEXP='((((h.|f).p)|mailto):(\/\/)?[^ >"]*|(www|ftp).[-a-z0-9.]+)[^ .,;>">]';
$REGEXP='((((h.|f).p)|mailto):(\/\/)?[^ >"]*|(www|ftp).[-a-z0-9.]+)';

if(/$REGEXP/) {
                $url=$1;
                print "<a href=\"" if ($full);
                print "ftp://"  if $url =~ /^ftp\./;
                print "http://" if $url =~ /^www/;
                print "$url";
                print "\">$url</a><br>" if ($full);
                print "\n" if (! ($url =~ /\n$/));
        }
}
----- END CUT -----