All pastes #552112 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-06-09 03:12 UTC
rendered paste body
#!/usr/bin/perl -w
use strict;
use LWP::Simple;

&update_database("microsoft","20070102","20070601");

sub update_database {
        $company = $_[0];
        $date1   = $_[1];
        $date2   = $_[2];
# and then pass without the double quotes

#my ($company, $date1, $date2) = shift;
        print $company . " " . $date1 . " " . $date2;
        my $url = "http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&u=%2Fnetahtml%2FP$
        $url .= "&Refine=Refine+Search&Refine=Refine+Search&Query=";
        $url .= "an%2F";
        $url .= $company; #"microsoft"; # define company
        $url .= "+and+";
        $url .= "isd%2F";
        $url .= $date1 . "-%3E" . $date2; #20070102-%3E20070601"; # define date range

        my $file = "gettotalnumber.html";
        my $response = getstore($url, $file);
        my $number;
        open $number, "<", $file or die("Can't open file");
        while (<$number>) {
                if (/<\/strong>\sout\sof\s<strong>(.*?)<\/strong>/) {
                        print $1;
                }
        }
        close $number;
}