`# $Header: /usr/local/cvsroot/webley/agents/www/www.pl,v 1.1
`1999/07/12 21:20:56 zhukoff Exp $
`# Agent to get info from the web
`use URI::URL;
`use LWP::UserAgent;
`use HTTP::Request::Common;
`#print "www: $ARGV[0] $ARGV[1]\n";
`#exit;
`my $debug = 0;
`my $debug2 = 0;
`%Data = &check_local( @ARGV );
`%Data = &check_global( @ARGV ) if $Data{ ERROR };
`exit;
`sub check_local {
`my ( $type, @param ) = @_;
`my %Data = ( ERROR => "In construction" );
`return %Data;
`ub check_global {
`my ( $type, @param ) = @_;
`if ( $type eq "weather" ) {
`if ( $param[ 0 ] =~ /\d+/ ) {
`# zip supplied
`&print_weather( &weather_zip( $ARGV[ 1 ] ) );
`lse {
`# city supplied
`}
`lsif ( $type eq "stock" ) {
`&print_stock( &stock_ticker( $ARGV[ 1 ] ) );
`}
`ub stock_ticker {
`my ( $ticker ) = @_;
`my %Stock;
`%Stock = &stock_ticker_yahoo( $ticker );
`return %Stock;
`ub weather_zip {
`my ( $zip ) = @_;
`my %Weather;
`%Weather = &weather_zip_cnn( $zip );
`&print_weather( %Weather ) if $debug2;
`return %Weather unless $Weather{ ERROR };
`undef %Weather;
`%Weather = &weather_zip_weather( $zip );
`
`}s
`
`}e
`
`}e
`
`1
`
`}s
`
`}s
`
`Parus Exhibit 2023
`Google, et al. v. Parus Holdings, Inc.
`IPR2020-00846
`Page 1 of 12
`
`
`
`&print_weather( %Weather ) if $debug2;
`return %Weather unless $Weather{ ERROR };
`undef %Weather;
`%Weather = &weather_zip_snap( $zip );
`&print_weather( %Weather ) if $debug2;
`return %Weather unless $Weather{ ERROR };
`undef %Weather;
`%Weather = &weather_zip_infospace( $zip );
`&print_weather( %Weather ) if $debug2;
`return %Weather unless $Weather{ ERROR };
`undef %Weather;
`%Weather = &weather_zip_lycos( $zip );
`return %Weather;
`http://cgi.cnn.com/cgi-bin/weather/redirect?zip=$zip
`#http://www.weather.com/weather/us/zips/$zip.html
`#http://feeds.infospace.com/info/USWS?QC=&QS=&QZ=$zip
`#http://home.snap.com/main/local/1,37,-3,00.html?zipCode=60004
`#http://weather.lycos.com/wcfiveday.asp?city=20000
`#http://www.wunderground.com/cgi-bin/findweather/getForecast?
`query=60053
`#http://www.accuweather.com/weatherf/iwxpage_mainf_qx01?zipcode=
`60089
`#http://infoseek.go.com/Centers/News/Weather?tid=1491&query=60089
`&sv=IS&lk=noframes
`#http://www.webcrawler.com/weather/forecast/city/?
`forecast_search=60053
`#http://www3.travelocity.com/weather/searchvalidate/1,1217,,00.ht
`ml?searchCity=kiev
`sub get_url_content {
`my ( $url ) = @_;
`my $ua = LWP::UserAgent->new;
`$ua->agent( 'Mozilla/4.0 [en] (X11; I; FreeBSD 2.2.8-STABLE
`i386)' );
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
`$url = url $url;
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request( GET $url );
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`return( $time, $res->content );
`ub stock_ticker_yahoo {
`my ( $stock ) = @_;
`my %Stock;
`my $url = "http://finance.yahoo.com/d/quotes.csv?s=
`$stock&f=sl1d1t1c1ohgv&e=.csv";
`
`}s
`
`}#
`
`2
`
`Parus Exhibit 2023, Page 2 of 12
`
`
`
`$Stock{ 'URL' } = $url;
`( $Stock{ 'TIME' }, $_ ) = &get_url_content( $url );
`( $Stock{ ticker },
` $Stock{ price },
` $Stock{ date },
` $Stock{ time },
` $Stock{ change },
` $Stock{ open },
` $Stock{ high },
` $Stock{ low },
` $Stock{ volume }
` )
`= /\"([^,]+)\",([^,]+),\"([^,]+)\",
`\"([^,]+)\",([^,]+),([^,]+),([^,]+),([^,]+),([^,]+)/;
`# split( /,/ );
`#
`if ( lc( $stock ) ne lc( $Stock{ ticker } ) ) {
`if ( $Stock{ price } == 0 ) {
`print "price $Stock{ price }\n";
`my %Stock = ( ERROR => "$url - Could not match",
` content => $_ );
`return %Stock;
`eturn %Stock;
`ub weather_zip_lycos {
`my ( $zip ) = @_;
`my $ua = LWP::UserAgent->new;
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
` my $url = url "http://weather.lycos.com/wcfiveday.asp?city=
`$zip";
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request(GET $url);
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`$_ = $res->content;
`s/\n/ /g;
`s/<br>/br/g;
`s/<\/TD>/td/g;
`s/<!.*?->//g;
`s/<[^<>]+>//g;
`s/\ / /g;
`s/\s+/ /g;
`print if $debug;
`my ( $Location,
`$current_day,
`$current_temperature_F,
`$current_weather,
`$Wind,
`$Humidity,
`$Pressure,
`$first_day_name,
`
`}r
`
`}s
`
`#
`
`3
`
`Parus Exhibit 2023, Page 3 of 12
`
`
`
`$second_day_name,
`$third_day_name,
`$fourth_day_name,
`$fifth_day_name,
`$first_day_weather,
`$second_day_weather,
`$third_day_weather,
`$fourth_day_weather,
`$fifth_day_weather,
`$first_day_high_F,
`$first_day_low_F,
`$second_day_high_F,
`$second_day_low_F,
`$third_day_high_F,
`$third_day_low_F,
`$fourth_day_high_F,
`$fourth_day_low_F,
`$fifth_day_high_F,
`$fifth_day_low_F,
`)
`=
`/Get a personalized forecast (?:.+)\. td (.+)td
`(.+) td td Current Conditions: temperature: (\S+)\° F or C
`\° sky: (.+) wind: (.+) relative humidity: (\S+) barometer:
`(.+) td td td 5-Day forecast: td (\S+)td (\S+)td (\S+)td (\S+)td
`(\S+)td td td td td td (.+) td (.+) td (.+) td (.+) td (.+) td hi
`(\S+)\°lo (\S+)\°td hi (\S+)\°lo (\S+)\°td hi
`(\S+)\°lo (\S+)\°td hi (\S+)\°lo (\S+)\°td hi
`(\S+)\°lo (\S+)\°td td td \&\#160;td Enter a city for
`forecasts/;
`if ( !$Location ) {
`my %Weather = ( ERROR => "$url - Could not match",
`content => $_ );
`return %Weather;
`current_weather =~ s/p\//partly /;
`$current_weather =~ s/m\//mostly /;
`$current_weather =~ s/t-/thunder /;
`$Wind =~ s/N/North/g;
`$Wind =~ s/W/West/g;
`$Wind =~ s/E/East/g;
`$Wind =~ s/S/South/g;
`$Wind =~ s/mph/miles per hour/;
`$Wind =~ s/kph/kilometers per hour/;
`$Weather{ 'Location' } = $Location;
`$Weather{ 'current month' } = $current_month;
`$Weather{ 'current day' } = $current_day;
`$Weather{ 'current time' } = $current_time;
`$Weather{ 'current weather' } = $current_weather;
`$Weather{ 'current temperature, F' } =
`$current_temperature_F;
`$Weather{ 'current temperature, C' } =
`
`}$
`
`4
`
`Parus Exhibit 2023, Page 4 of 12
`
`
`
`$current_temperature_C;
`$Weather{ 'Humidity' } = $Humidity;
`$Weather{ 'Wind' } = $Wind;
`$Weather{ 'URL' } = $url;
`$Weather{ 'TIME' } = $time;
`return %Weather;
`ub weather_zip_snap {
`my ( $zip ) = @_;
`my $ua = LWP::UserAgent->new;
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
` my $url = url
`"http://home.snap.com/main/local/1,37,-3,00.html?zipCode=$zip";
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request(GET $url);
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`$_ = $res->content;
`s/\n/ /g;
`s/<br>/br/g;
`s/<\/td>/td/g;
`s/<!.*?->//g;
`s/<[^<>]+>//g;
`s/\ / /g;
`s/\s+/ /g;
`print if $debug;
`my ( $Location,
`$current_temperature_F,
`$first_day_high_F,
`$first_day_low_F,
`$current_weather,
`$Humidity,
`$Wind,
`$Pressure,
`$first_day_name,
`$second_day_name,
`$third_day_name,
`$fourth_day_name,
`$fifth_day_name,
`$first_day_weather,
`$second_day_weather,
`$third_day_weather,
`$fourth_day_weather,
`$fifth_day_weather,
`$first_day_high_F,
`$first_day_low_F,
`$second_day_high_F,
`$second_day_low_F,
`$third_day_high_F,
`$third_day_low_F,
`$fourth_day_high_F,
`
`}s
`
`#
`
`5
`
`Parus Exhibit 2023, Page 5 of 12
`
`
`
`$fourth_day_low_F,
`$fifth_day_high_F,
`$fifth_day_low_F,
`)
`=
`/td td Home: Local: (.+) Weather Center tdtdtd td
`td(?:.*) News \| Sports \| Our Community \| Classifieds \&
`Auctions tdtd Weekly Weather Forecasttd td td td(?:.*) Today\'s
`Current Conditions \(Updated approximately every hour\) (\S+)o td
`td td (\S+)otd Hitd td (\S+)o Lotd td (.+) Humidity: (\S+) Wind:
`(.+) Barometric Pressure: (\S+)td View Weather in Another City
`Enter a 5-digit ZIP code: Or Browse by Statetd td(?:.*) td Snap
`Weather Categoriestd td \&\#149; General Weather \&\#149; Road
`Conditions \&\#149; Storm-Chasing \&\#149; Seismology \&\#149;
`Meteorology \&\#149; Weather Centers \&\#149; Surf Reports \&\#
`149; Astronomytd td Closest weather station: (?:.*)td td td td td
`td (\S+)td (\S+)td (\S+)td (\S+)td (\S+)td (.+)td (.+)td (.+)td
`(.+)td (.+)td Hi (\S+)\/Lo (\S+)td Hi (\S+)\/Lo (\S+)td Hi
`(\S+)\/Lo (\S+)td Hi (\S+)\/Lo (\S+)td Hi (\S+)\/Lo (\S+)td
`Regional Doppler Radartd/;
`if ( !$Location ) {
`my %Weather = ( ERROR => "$url - Could not match",
`content => $_ );
`return %Weather;
`current_weather =~ s/p\//partly /;
`$current_weather =~ s/m\//mostly /;
`$current_weather =~ s/t-/thunder /;
`$Wind =~ s/N/North/g;
`$Wind =~ s/W/West/g;
`$Wind =~ s/E/East/g;
`$Wind =~ s/S/South/g;
`$Wind =~ s/mph/miles per hour/;
`$Wind =~ s/kph/kilometers per hour/;
`$Weather{ 'Location' } = $Location;
`$Weather{ 'current month' } = $current_month;
`$Weather{ 'current day' } = $current_day;
`$Weather{ 'current time' } = $current_time;
`$Weather{ 'current weather' } = $current_weather;
`$Weather{ 'current temperature, F' } =
`$current_temperature_F;
`$Weather{ 'current temperature, C' } =
`$current_temperature_C;
`$Weather{ 'Humidity' } = $Humidity;
`$Weather{ 'Wind' } = $Wind;
`$Weather{ 'URL' } = $url;
`$Weather{ 'TIME' } = $time;
`return %Weather;
`ub weather_zip_infospace {
`my ( $zip ) = @_;
`my $ua = LWP::UserAgent->new;
`
`}$
`
`}s
`
`6
`
`Parus Exhibit 2023, Page 6 of 12
`
`
`
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
` my $url = url "http://feeds.infospace.com/info/USWS?
`QC=&QS=&QZ=$zip";
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request(GET $url);
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`$_ = $res->content;
`s/\n/ /g;
`s/<br>/br/g;
`s/<!.*?->//g;
`s/<[^<>]+>//g;
`s/\ / /g;
`s/\s+/ /g;
`print if $debug;
`my ( $Location,
`$current_temperature_F,
`$current_weather,
`$Wind,
`$Pressure,
`$second_day_name,
`$third_day_name,
`$fourth_day_name,
`$fifth_day_name,
`$sixth_day_name,
`$second_day_high_F,
`$second_day_low_F,
`$third_day_high_F,
`$third_day_low_F,
`$fourth_day_high_F,
`$fourth_day_low_F,
`$fifth_day_high_F,
`$fifth_day_low_F,
`$sixth_day_high_F,
`$sixth_day_low_F,
`$second_day_weather,
`$third_day_weather,
`$fourth_day_weather,
`$fifth_day_weather,
`$sixth_day_weather,
`)
`=
`/City Guide \> (.+) \> Weather Weather
`Conditions and forecast for (?:.+) Most Recent Reportbr br (\S+)
`F br (.+) br Wind: (.+) br Pressure: (.+) br Five-Day Forecastbr
`(\S+)br (\S+)br (\S+)br (\S+)br (\S+)br (\S+) - (\S+)br (\S+) -
`(\S+)br (\S+) - (\S+)br (\S+) - (\S+)br (\S+) - (\S+)br (.+) br
`(.+) br (.+) br (.+) br (.+) br Get Weather for Another City/;
`if ( !$Location ) {
`my %Weather = ( ERROR => "$url - Could not match",
`content => $_ );
`
`7
`
`Parus Exhibit 2023, Page 7 of 12
`
`
`
`return %Weather;
`current_weather =~ s/p\//partly /;
`$current_weather =~ s/m\//mostly /;
`$current_weather =~ s/t-/thunder /;
`$Wind =~ s/N/North/g;
`$Wind =~ s/W/West/g;
`$Wind =~ s/E/East/g;
`$Wind =~ s/S/South/g;
`$Wind =~ s/mph/miles per hour/;
`$Wind =~ s/kph/kilometers per hour/;
`$Weather{ 'Location' } = $Location;
`$Weather{ 'current month' } = $current_month;
`$Weather{ 'current day' } = $current_day;
`$Weather{ 'current time' } = $current_time;
`$Weather{ 'current weather' } = $current_weather;
`$Weather{ 'current temperature, F' } =
`$current_temperature_F;
`$Weather{ 'current temperature, C' } =
`$current_temperature_C;
`$Weather{ 'Humidity' } = $Humidity;
`$Weather{ 'Wind' } = $Wind;
`$Weather{ 'URL' } = $url;
`$Weather{ 'TIME' } = $time;
`return %Weather;
`ub weather_zip_weather {
`my ( $zip ) = @_;
`my $ua = LWP::UserAgent->new;
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
`my $url = url "http://www.weather.com/weather/us/zips/
`$zip.html";
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request(GET $url);
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`$_ = $res->content;
`s/\n/ /g;
`s/<!.*?->//g;
`s/<[^<>]+>//g;
`s/\ / /g;
`s/\s+/ /g;
`print if $debug;
`my ( $Location,
`$current_day_name,
`$current_month,
`$current_day,
`$current_time,
`$Sunrise,
`$Sunset,
`$current_temperature_F,
`
`}s
`
`}$
`
`8
`
`Parus Exhibit 2023, Page 8 of 12
`
`
`
`$current_weather,
`$Wind,
`$Humidity,
`$Pressure,
`$forecast_last_update,
`$first_day_name,
`$second_day_name,
`$third_day_name,
`$fourth_day_name,
`$fifth_day_name,
`$first_day_weather,
`$second_day_weather,
`$third_day_weather,
`$fourth_day_weather,
`$fifth_day_weather,
`$first_day_low_F,
`$first_day_high_F,
`$second_day_low_F,
`$second_day_high_F,
`$third_day_low_F,
`$third_day_high_F,
`$fourth_day_low_F,
`$fourth_day_high_F,
`$fifth_day_low_F,
`$fifth_day_high_F,
`)
`=
`/Site Map Talk To Us! (.+) \(\d+\) current
`conditions as reported at (?:.+) (\S+), (\S+) (\S+) last updated
`at (.+) Sunrise: (.+) Sunset: (.+) current temp: (\S+)\°F
`(\S+) wind: (.+) relative humidity: (\S+) barometer: (.+)(?:
`detailed local forecast)? 5-day forecast for (?:.+) last updated
`at (.+) (\w{3}) (\w{3}) (\w{3}) (\w{3}) (\w{3}) (\S+) (\S+) (\S+)
`(\S+) (\S+) lo (\S+)\° hi (\S+)\° lo (\S+)\° hi
`(\S+)\° lo (\S+)\° hi (\S+)\° lo (\S+)\° hi
`(\S+)\° lo (\S+)\° hi (\S+)\° Conversions - enter/;
`if ( !$Location ) {
`my %Weather = ( ERROR => "$url - Could not match",
`content => $_ );
`return %Weather;
`current_weather =~ s/p\//partly /;
`$current_weather =~ s/m\//mostly /;
`$current_weather =~ s/t-/thunder /;
`$Wind =~ s/N/North/g;
`$Wind =~ s/W/West/g;
`$Wind =~ s/E/East/g;
`$Wind =~ s/S/South/g;
`$Wind =~ s/mph/miles per hour/;
`$Wind =~ s/kph/kilometers per hour/;
`$Weather{ 'Location' } = $Location;
`$Weather{ 'current month' } = $current_month;
`
`}$
`
`9
`
`Parus Exhibit 2023, Page 9 of 12
`
`
`
`$Weather{ 'current day' } = $current_day;
`$Weather{ 'current time' } = $current_time;
`$Weather{ 'current weather' } = $current_weather;
`$Weather{ 'current temperature, F' } =
`$current_temperature_F;
`$Weather{ 'current temperature, C' } =
`$current_temperature_C;
`$Weather{ 'Humidity' } = $Humidity;
`$Weather{ 'Wind' } = $Wind;
`$Weather{ 'URL' } = $url;
`$Weather{ 'TIME' } = $time;
`return %Weather;
`ub weather_zip_cnn {
`my ( $zip ) = @_;
`my $ua = LWP::UserAgent->new;
`$ua->proxy( ['http', 'https'], 'http://proxy.vail:3128/' );
`$ua->no_proxy( 'webley', 'vail' );
`my $url = url "http://cgi.cnn.com/cgi-bin/weather/redirect?
`zip=$zip";
`print "$url\n" if $debug2;
`my $time = time;
`my $res = $ua->request(GET $url);
`print "Response: " . ( time - $time ) . "sec\n" if $debug2;
`$_ = $res->content;
`s/\n/ /g;
`s/<[^<>]+>//g;
`s/\s+/ /g;
`print if $debug;
`my ( $Location,
`$first_day_name,
`$first_day_weather,
`$first_day_high_F,
`$first_day_high_C,
`$first_day_low_F,
`$first_day_low_C,
`$second_day_name,
`$second_day_weather,
`$second_day_high_F,
`$second_day_high_C,
`$second_day_low_F,
`$second_day_low_C,
`$third_day_name,
`$third_day_weather,
`$third_day_high_F,
`$third_day_high_C,
`$third_day_low_F,
`$third_day_low_C,
`$fourth_day_name,
`$fourth_day_weather,
`$fourth_day_high_F,
`$fourth_day_high_C,
`
`}s
`
`10
`
`Parus Exhibit 2023, Page 10 of 12
`
`
`
`$fourth_day_low_F,
`$fourth_day_low_C,
`$undef,
`$current_time,
`$current_month,
`$current_day,
`$current_weather,
`$current_temperature_F,
`$current_temperature_C,
`$Humidity,
`$Wind,
`$Pressure,
`$Sunrise,
`$Sunset,
`)
`= /Keyword Title Author \ \; (.+) Forecast FOUR-
`DAY FORECAST (\S+) (\S+) HIGH (\S+) F (\S+) C LOW (\S+) F (\S+) C
`(\S+) (\S+) HIGH (\S+) F (\S+) C LOW (\S+) F (\S+) C (\S+) (\S+)
`HIGH (\S+) F (\S+) C LOW (\S+) F (\S+) C (\S+) (\S+) HIGH (\S+) F
`(\S+) C LOW (\S+) F (\S+) C WEATHER MAPS RADAR (.+) Forecast
`CURRENT CONDITIONS (.+) \(local\), (\S+) (\S+) (.+) Temp: (\S+)
`F, (\S+) C Rel. Humidity: (\S+) Wind: (.+) Pressure: (.+)
`Sunrise: (.+) Sunset: (.+) RELATED LINKS/;
`if ( !$Location ) {
`my %Weather = ( ERROR => "$url - Could not match",
`content => $_ );
`return %Weather;
`current_weather =~ s/p\//partly /;
`$current_weather =~ s/m\//mostly /;
`$current_weather =~ s/t-/thunder /;
`$Wind =~ s/N/North/g;
`$Wind =~ s/W/West/g;
`$Wind =~ s/E/East/g;
`$Wind =~ s/S/South/g;
`$Wind =~ s/mph/miles per hour/;
`$Wind =~ s/kph/kilometers per hour/;
`$Weather{ 'Location' } = $Location;
`$Weather{ 'current month' } = $current_month;
`$Weather{ 'current day' } = $current_day;
`$Weather{ 'current time' } = $current_time;
`$Weather{ 'current weather' } = $current_weather;
`$Weather{ 'current temperature, F' } =
`$current_temperature_F;
`$Weather{ 'current temperature, C' } =
`$current_temperature_C;
`$Weather{ 'Humidity' } = $Humidity;
`$Weather{ 'Wind' } = $Wind;
`$Weather{ 'URL' } = $url;
`$Weather{ 'TIME' } = $time;
`return %Weather;
`
`}$
`
`}
`
`11
`
`Parus Exhibit 2023, Page 11 of 12
`
`
`
`sub print_weather {
`my %Weather = @_;
`die "Error: $Weather{ ERROR }\n $Weather{ content }\n" if
`$Weather{ ERROR };
`print "
`Current weather in $Weather{ Location } on $Weather{ 'current
`month' } $Weather{ 'current day' } at $Weather{ 'current
`time' }:
`$Weather{ 'current weather' },
`$Weather{ 'current temperature, F' } Farenheit, "
`. int( ( int( $Weather{ 'current temperature, F' } ) - 32 ) * 5 /
`9 ) . " Celsium,
`Humidity $Weather{ 'Humidity' },
`Wind $Weather{ 'Wind' }
`";
`ub print_stock {
`my %Stock = @_;
`die "Error: $Stock{ ERROR }\n $Stock{ content }\n" if
`$Stock{ ERROR };
`print "
`Ticker $Stock{ ticker }
`Last trade price $Stock{ price }
`Last trade time $Stock{ date } $Stock{ time }
`Change since previous close $Stock{ change }
`Today's opening price $Stock{ open }
`Today's high price $Stock{ high }
`Today's low price $Stock{ low }
`Today's volume $Stock{ volume }
`";
`}
`
`}s
`
`12
`
`Parus Exhibit 2023, Page 12 of 12
`
`