Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env perl
- # Copyright (c) 2011, Markus Peloquin <markus@cs.wisc.edu>
- #
- # Permission to use, copy, modify, and/or distribute this software for any
- # purpose with or without fee is hereby granted, provided that the above
- # copyright notice and this permission notice appear in all copies.
- #
- # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- # SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- use strict;
- use warnings;
- use CGI;
- my @TARGET_ADDRS = qw/
- addr1@host1
- addr2@host2
- /;
- my $q = CGI->new;
- my $found = $q->param('found');
- my @found = split /,/, $found;
- my %found_map;
- $found_map{$_} = 1 for @found;
- my $area_code = @found > 1 ? 'area codes': 'area code';
- my $msg = <<EOF;
- From: markus\@cs.wisc.edu
- Subject: GOOGLE VOICE NUMBER AVAILABLE
- $area_code with at least one number: @found
- EOF
- for my $addr (@TARGET_ADDRS) {
- open my $output, '|-', "/usr/sbin/sendmail $addr" or
- die "$0: sendmail couldn't exec: $!";
- print $output $msg or die "$0: failed to write email: $!";
- close $output;
- }
- # this actually doesn't matter since the google voice page is HTTPS so the
- # results are just ignored
- print $q->header(-type => 'text/javascript');
- printf "{ \"bluh_bluh\": \"%s\" }\n", $found;
Add Comment
Please, Sign In to add comment