302 Object Moved on sockopen - 21/03/07 04:54 AM
The script is basically to use that website and get the city, state, and ISP of the user. Everytime I try to connect to the website (through mIRC) I get a 302, but if I connect through firefox it works fine. At the moment I am just trying to get the city and see if it is even possible first.
Code:
on *:DNS:{ set %resolved $raddress } ALIAS iplocate { set %iploc 1 sockclose iploc sockopen iploc www.melissadata.com 80 } ALIAS halnohtml var %haltmp , %i = $regsub($1-,/(<[^>]+>)/g,$chr(32),%haltmp) | return %haltmp on *:SOCKOPEN:iploc: { sockwrite -n $sockname GET /lookups/iplocation.asp?ipaddress= $+ %resolved HTTP/1.1 sockwrite -n $sockname Host: www.melissadata.com sockwrite -n $sockname User-agent: mIRC/ $+ $version sockwrite -n $sockname $crlf } on *:SOCKREAD:iploc: { if ($sockerr > 0) { return } var %haltmp | sockread %haltmp echo -a %haltmp while ($sockbr) { if ( <tr><td align="right">City</td><td><b>*</b></td></tr> iswm %haltmp ) { set %info. [ $+ [ %iploc ] ] $halnohtml(%haltmp) inc %iploc } set %mytemp $halnohtml(%haltmp) sockread %haltmp echo -a %info.1 } }