This lets you use those cool bar code readers from Radio Shack (the free ones), the homepage is
gorn.8m.com. Have fun.
#!/usr/bin/perl -w
if ($ARGV[0]) { $BROWSER = $ARGV[0];}
else {$BROWSER = 'netscape';}
$debug = 0;
if (open(CODE, "$ENV{'HOME'}/.gqkatcode")) {
$code = <CODE>;
chomp $code;
close(CODE);
} else {
print ":Cue:Cat requires registration..\n";
print "Enter the ID Number you get When ready\n";
print ":Cue:Cat ID: ";
&openBrowser('http://net.c-me-register.com/');
$code = <STDIN>;
open(CODE, "$ENV{'HOME'}/.gqkatcode");
print CODE $code;
chomp $code;
close(CODE);
}
print "Skan the the :Kue:Kat: ";
$barcode = <STDIN>;
chomp $barcode;
$barcode = substr $barcode,0,-1;
print $barcode if $debug == 1;
$barcode = substr $barcode,7;
$barcode =~ tr/a-zA-Z/A-Za-z/;
print $barcode if $debug == 1;
#@data = `links -source 'http://u.dcnv.com/CRQ/1..$code.04.$barcode.0'
+`;
use IO::Socket;
$dcnv = IO::Socket::INET->new( Proto=> "tcp",
PeerAddr => "u.dcnv.com",
PeerPort => 80) ||
die "Can't Connect To U.DCNV.com: $!";
$dcnv->autoflush(1);
print $dcnv "GET /CRQ/1..$code.04.$barcode.0 HTTP/1.1\r\n";
print $dcnv "Host: u.dcnv.com\r\n";
print $dcnv "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0)\r\n";
print $dcnv "Accept: */*\r\n";
print $dcnv "Accept-Charset: us-ascii, ISO-8859-1, ISO-8859-2, ISO-885
+9-4, ISO-8895-5, ISO-8859-13, windows-1250, windows-1251, windows-125
+7, cp437, cp850, cp852, cp866, x-cp866-u, x-mac-ce, x-kam-cs, x-koi8-
+r, x-koi8-u, utf-8\r\n";
print $dcnv "Connection: Keep-Alive\r\n";
print $dcnv "\r\n";
while($foo = <$dcnv>) {
if ($foo =~ /^url\=/) {
$url = $foo;
$url =~ s/^url\=//;
close($dcnv);
}
}
close($dcnv) if $dcnv;
&openBrowser("$url");
sub openBrowser() {
$URL = $_[0];
chomp $URL;
`$BROWSER \'$URL\' &> ./test &`;
}