#!/usr/bin/perl

use LWP::Simple;
use LWP::UserAgent;

$product_id = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36";

@show = (
   'Tim Marshall',
   'Jr Hehnly',
   'Bill Oosterbaan'
);

print "Content-type: text/plain\n\n";
print <<EOF;
Refresh: 1
Threshold: 999
Title: Ben Holcomb Custom SN Positions
Font: 1, 14, 0, "Arial"
IconFile: 1, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spotternet.png"
IconFile: 2, 15, 25, 8, 25, "http://www.spotternetwork.org/icon/arrows.png"
IconFile: 6, 22, 22, 11, 11, "http://www.spotternetwork.org/icon/spotternet_new.png"
EOF

$ua = LWP::UserAgent->new;
$ua->agent ($product_id);

my $sn = $ua->get ('https://www.spotternetwork.org/feeds/gr.txt');

$x = length $sn->decoded_content;
$sndec = substr($sn->decoded_content, 352, $x-352);

my @values = split('End:', $sndec);

foreach my $val (@values){
        if($val =~ m/Text:\s15\,\s10\,\s1\,\s\"(.+)\"/g){
                        my $name = $1;
                        if ($name ~~ @show){
                                print $val;
                                print "End:\n"
                        }
        }
}