Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on *:sockopen:iplook: {
- if ($sockerr) {
- var %c = $gettok($sock($sockname).mark,1,32)
- if ($me ison %c) { .msg %c There was an connection error between the website and ip-info! - (Error Code: $sock($sockname).wserr $+ ) - (Error Details: $sock($sockname).wsmsg $+ ) }
- sockclose $sockname
- return
- }
- sockwrite -nt $sockname GET $gettok($sock($sockname).mark,2,32) HTTP/1.1
- sockwrite -nt $sockname User-Agent: Mozilla/4.0
- sockwrite -nt $sockname Host: whatismyipaddress.com
- sockwrite $sockname $crlf
- }
- on *:sockread:iplook: {
- if ($sockerr) {
- var %c = $gettok($sock($sockname).mark,1,32)
- if ($me ison %c) { .msg %c There was an connection reading error between the website and ip-info! - (Error Code: $sock($sockname).wserr $+ ) - (Error Details: $sock($sockname).wsmsg $+ ) }
- sockclose $sockname
- return
- }
- var %read
- sockread %read
- ;echo -at %read
- if (*!*PAC* iswm %read) { set -e %ippac 1 }
- if (%ippac) {
- ;echo -at $findtok(%read,>,0,62)
- if (*Decimal:* iswm %read) { set -e %decimal $iif($gettok($gettok(%read,$calc($findtok(%read,Decimal:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
- if (*Hostname:* iswm %read) { set -e %hostname $iif($gettok($gettok(%read,$calc($findtok(%read,Hostname:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
- if (*ASN:* iswm %read) { set -e %asn $iif($gettok($gettok(%read,$calc($findtok(%read,ASN:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
- if (*ISP:* iswm %read) { set -e %isp $iif($gettok($gettok(%read,$calc($findtok(%read,ISP:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
- if (*Organization:* iswm %read) { set -e %org $iif($gettok($gettok(%read,$calc($findtok(%read,Organization:</th,1,62) + 2),62),1,60) == /td, Not Found, $v1) }
- if (*Type:* iswm %read) { set -e %type $iif($gettok($gettok(%read,$calc($findtok(%read,Type:</th,1,62) + 3),62),1,60) == /td, Not Found, $v1) }
- if (*Assignment:* iswm %read) { set -e %assign $iif($gettok($gettok(%read,$calc($findtok(%read,Assignment:</th,1,62) + 3),62),1,60) == /td, Not Found, $v1) }
- }
- if (*/table></form* iswm %read) {
- var %c = $gettok($sock($sockname).mark,1,32)
- unset %ippac
- if ($me ison %c) { msg %c $iif(%decimal !== NA, 3Decimal:7 $v1,N/A) $iif(%hostname !== NA, 3Hostname:7 $v1,N/A) $iif(%asn !== NA, 3ASN:7 $v1,N/A) $iif(%isp == %org && %isp !== NA, 3ISP/Org:7 %isp, $iif(%isp !== NA, 3ISP:7 %isp,N/A) $iif(%org !== NA, 3Organization:7 $v1,N/A)) $iif(%type !== NA, 3Type:7 $v1,N/A) $iif(%assign !== NA, 3Assignment:7 $v1,N/A) }
- }
- if (*h2 id="Geolocation-Information* iswm %read) { set -e %geost 1 }
- if (*Continent:* iswm %read) { set -e %continent $gettok($gettok(%read,$calc($findtok(%read,Continent:</th,1,62) + 2),62),1,60) }
- if (*Country:* iswm %read) { set -e %country $gettok($gettok(%read,$calc($findtok(%read,Country:</th,1,62) + 2),62),1,60) }
- if (*State/Region* iswm %read) { set -e %streg $gettok($gettok(%read,$calc($findtok(%read,State/Region:</th,1,62) + 2),62),1,60) }
- if (*City* iswm %read) { set -e %city $gettok($gettok(%read,$calc($findtok(%read,City:</th,1,62) + 2),62),1,60) }
- if (*Latitude* iswm %read) { set -e %findlat 1 }
- if (%findlat) && (*Latitude* !iswm %read) {
- unset %findlat
- set -e %latitude $gettok(%read,1,38)
- }
- if (*Longitude* iswm %read) { set -e %findlong 1 }
- if (%findlong) && (*Longitude* !iswm %read) {
- unset %findlong
- set -e %longitude $gettok(%read,1,38)
- }
- if (*Postal* iswm %read) { set -e %PostalCode $gettok($gettok(%read,$calc($findtok(%read,Postal Code:</th,1,62) + 2),62),1,60) }
- if (*/table* iswm %read) && (%geost) {
- var %c = $gettok($sock($sockname).mark,1,32)
- if ($me ison %c) { msg %c $iif(%continent,3Continent:7 $v1,N/A) $iif(%country, 3Country:7 $v1,N/A) $iif(%streg, 3State/Region:7 $v1,N/A) $iif(%city, 3City:7 $v1,N/A) $iif(%latitude, 3Latitude:7 $v1,N/A) $iif(%longitude, 3Longitude:7 $v1,N/A) $iif(%postalcode, 3Postal Code:7 $v1,N/A) }
- unset %geost
- unset %isp
- unset %hostname
- unset %decimal
- unset %org
- unset %asn
- unset %assign
- unset %type
- unset %iplook
- unset %ipchan
- unset %continent
- unset %country
- unset %streg
- unset %city
- unset %latitude
- unset %lognitude
- unset %postalcode
- sockclose $sockname
- return
- }
- }
- on *:TEXT:*:#: {
- tokenize 32 $strip($1-)
- if ($1 == !ipinfo) {
- if (!$2) { .msg $chan ( $+ $nick $+ ): Error, Please specify an IP address! | return }
- if ($remove($2,.) !isnum) { .msg $chan ( $+ $+ $nick $+ ): Error, Please specify an IP correctly! | return }
- msg $chan Looking Up IP: $2
- sockopen iplook whatismyipaddress.com 80
- sockmark iplook $chan $+(/ip/,$2)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement