Code: Select all
bind pub - .ip msg_ipwhois
proc msg_ipwhois {nick uhost hand chan text} {
global botnick
if {$text == "" } {putquick "PRIVMSG $chan :You have to use true command for look up whois information. Command: .ip ipnumber";return}
if {[string match -nocase "*" $text]} {
set connect [::http::geturl https://whatismyipaddress.com/ip/$text]
set files [::http::data $connect]
::http::cleanup $files
regexp -- {<p class="information"><span>Hostname:</span><span>(.+)</span>} $files - hostname
regexp -- {<p class="information"><span>ISP:</span><span>(.+)</span>} $files - isp
regexp -- {<p class="information"><span>State/Region:</span><span>(.+)</span>} $files - state
regexp -- {<p class="information"><span>Country:</span><span>(.+)</span>} $files - country
regexp -- {<p class="information"><span>City:</span><span>(.+)</span>} $files - city
regexp -- {<p class="information"><span>Latitude:</span><span>(.+)</span>} $files - latitude
regexp -- {<p class="information"><span>Longitude:</span><span>(.+)</span>} $files - longitude
if {[info exists country]} {
puthelp "privmsg $chan :IP: $text - ISP: $isp - Hostname: $hostname - Country: $country Latitude: $latitude Longitude: $longitude"
if {[info exists state]} {
puthelp "privmsg $chan :State: $state - City: $city"
}
} else { puthelp "privmsg $chan :Invalid address or IP not found" }
}
}
This TCL doesn't work... just mention this on the channel
Code: Select all
[23:52] <@Kantuta> Invalid address or IP not found
But when I go to the verification page, it works fine... it seems something is wrong with the TCL.
I'm not sure but the fault might come from here.
Code: Select all
if {[string match -nocase "*" $text]} {