I tried emailing the author of this script, but no luck. Can someone please modify the following script to pull the data from "http://www.ip-adress.com/ip_tracer/" instead of "www.ip2location.com". I find that ip2location do not have very accurate information.
Thanks!
Code: Select all
#########################################################################
# Public IP Information Checker by Hawkee - lowraider1@gmail.com #
#-----------------------------------------------------------------------#
# This script uses www.ip2location.com to check for info on ip adresses #
# i'm not quite sure if the login method i made work 100 %, but it #
# seemd to work for me. I have spotted a bug by now, i will review it #
# in a future version. #
# You can use it in 2 modes: THE FREE ONE or THE Account one #
# #
# The free one works for 20 IP lookups per day, because this is the #
# maximum number of lookups, ip2location.com offers for unregistered #
# users - per ip -. Set ip2loc(account) (default) to use this. #
# #
# The Account one works for 200 lookups per day if you have a #
# ip2location.com account. The login method for this mode is not #
# guaranteed to work. But you can try. You must set ip2loc(account) to #
# 1 and you must set ip2loc(mail) & ip2loc(pass) with your ip2location #
# account details. #
# Thats all about the important info. #
# #
# Works on all channels, and it can be used by all users. Requires TCL #
# HTTP PACK #
# #
# USAGE: !whereis <IP> #
# HAVE PHUN #
# Email me with suggestions and bug reports #
# #
# grtz HWK @ undernet #
#########################################################################
bind pub -|- !whereis whereis
set ver "0.1"
set ip2loc(account) "0"
set ip2loc(mail) "your ip2location.com account email adress"
set ip2loc(pass) "your ip2location.com account password"
package require http
# DO NOT EDIT BELOW #
proc whereis {nick uhost hand chan args} {
global ip2loc
set ip [lindex $args 0]
::http::config -useragent "Mozilla/5.0 ; Gecko"
if {![info exists authed] && $ip2loc(account) == "1"} {
set auth [::http::formatQuery txtEmailAddress $ip2loc(mail) txtPassword $ip2loc(pass) chkRememberMe on]
::http::geturl "http://www.ip2location.com/login.aspx" -timeout 2000 -query $auth -type mime-type
puthelp "privmsg $chan :Authentificating to website"
set authed "1"
putlog "IP INFO - Logging in to website"
}
if {![string match -nocase *.*.*.* $ip]} {puthelp "NOTICE $nick Invalid IP pattern. \037Syntax\037: \002!whereis\002 <xxx.xxx.xxx.xxx>" ; putlog "IP INFO $chan $nick - INVALID IP PATTERN"; return 0}
set que [::http::formatQuery ipaddresses $ip]
set http_req [::http::geturl "http://www.ip2location.com/demo.aspx" -timeout 2000 -query $que]
set data [::http::data $http_req]
::http::cleanup $http_req
regexp {<span id="dgLookup__ctl2_lblICountry">([^<]+)</span></TD>} $data x country
if {![info exists country] || [string equal $country -]} {puthelp "NOTICE $nick :$nick, no information found for IP: \00302$ip\003" ; putlog "IP INFO $chan $nick - No results" ; return 0}
regexp {<span id="dgLookup__ctl2_lblICity">([^<]+)</span></TD>} $data x city
regexp {<span id="dgLookup__ctl2_lblIISP">([^<]+)</span></TD>} $data x isp
regexp {<span id="dgLookup__ctl2_lblIDomain">([^<]+)</span></TD>} $data x domain
puthelp "privmsg $chan \037Location\037 - \002Country:\002 \00304$country\003, \002City:\002 \00304$city\003"
putlog "IP INFO $chan $nick"
}
putlog "*Ip Information v$ver* Loaded"