diff --git a/README.md b/README.md index 763d7f4..14f3d8d 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,6 @@ This is a collection of simple but effective tools to use on the command line to **alert** - alert (play sound) when a command completes `alert dd if=file.iso of=disk` -**alexa** - get Alexa.com ranking for a site -`alexa cnn.com` - **all** - loop a command over a list of files `all 'tar -zxvf FILE' *tgz` diff --git a/alexa b/alexa deleted file mode 100755 index 06cb3cd..0000000 --- a/alexa +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/perl - -my $CSV = "/Users/samy/code/alexa/top-1m.csv"; - -use strict; - -if (-t STDIN and !@ARGV) -{ - die "usage: $0 [site ...] (or piped in)\n"; -} - -my %sites; -open(F, "<$CSV") || die "Can't read $CSV: $!"; - -my $sites = join("|", map { fix($_) } @ARGV); - -if (!-t STDIN) -{ - $sites .= "|" if $sites; - while () - { - chomp; - $sites .= fix($_) . "|"; - } - chop($sites); -} - -#die $sites; -while () -{ - chomp; - my ($i, $url) = split(/,/, $_, 2); - if ($url =~ /^($sites)$/) - { - print "$i\t$url\n"; - } -} -close(F); - - -sub fix -{ - my $url = lc shift; - $url =~ s/^https?:\/\/(?:www\.)?//i; - return $url; -} \ No newline at end of file