mIRC Home    About    Download    Register    News    Help

Print Thread
#123409 23/06/05 03:11 AM
Joined: Nov 2004
Posts: 15
V
Pikka bird
OP Offline
Pikka bird
V
Joined: Nov 2004
Posts: 15
Based on his/her ip/hostname, can we work out which country he/she come from when he/she joins channel? If it is possible, can you guys help me ? thanks smile

#123410 23/06/05 03:25 AM
Joined: Jun 2005
Posts: 3
T
Self-satisified door
Offline
Self-satisified door
T
Joined: Jun 2005
Posts: 3
muahhhhhh!! its so lame crazy

#123411 23/06/05 04:15 AM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
you can get a list of the country codes from This page and put it in a text file, then add a on join event to your remotes.
Code:
on *:JOIN:#:{
  var %token = $gettok($address(nick,3),0,46)
  var %code = $gettok($address(nick,3),%token,46)
  echo -a $nick might be from $read(countrycode.txt,w,%code)
}

it will NOT work for IP address, and net com org edu and others can be from anywhere, so this is of limited usefullness.

#123412 23/06/05 06:08 AM
Joined: Feb 2005
Posts: 74
S
Babel fish
Offline
Babel fish
S
Joined: Feb 2005
Posts: 74
You have a mistake in this code:
Code:
 
on *:JOIN:#:{
  var %token = $gettok($address([color:red]$[/color]nick,3),0,46)
  var %code = $gettok($address([color:red]$[/color]nick,3),%token,46)
  echo -a $nick might be from $read(countrycode.txt,w,%code)
}


[color:red]m[color:blue]IRC[color:green] for EvEr

#123413 23/06/05 06:30 AM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
How about this, basing from the referred website

Code:
 on *:JOIN:#: echo $chan $nick might be from $read(countrycode.txt,s,$+(.,$gettok($address($nick,3),-1,46)))

Last edited by xDaeMoN; 23/06/05 06:36 AM.

If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#123414 23/06/05 05:12 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
DOH! blush

I missed that

#123415 23/06/05 06:06 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
hmm I also missed using a * with the $read( ,w, ) and the . prefix shown on that page (I have that list but without the .)

missing from that page are the Generic codes:
.com International Commercial
.net International Network (Commercial)
.org International "Anyone"
.mil US Military
.gov US Govermental Federal & State
.aero International (SITA) Aeronautics
.coop International "Co-coperatives"
.edu School (postsecondary institutions)
.info International "Anyone"
.int domain is used only for registering organizations established by international treaties between governments.
.museum International Museum
.name International "Anyone"
.pro International Credentialed Professionals

and any others I might have missed smile

#123416 23/06/05 06:17 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
You can socket a whois site such as http://ws.arin.net/whois to get the Organization's Name who owns the IP/DNS and their address. That can give a general idea of where they are.

The downside of that is that the IP/DNS may be owned by someone in one country, but located in another country.

If you don't have a DNS, you could also socket an IP to DNS site to find out the correct DNS name, which would help for hosts that aren't just standard .com/.net/.org/etc.

An example site being: http://www.saliu.com/cgi/IPtoDNS.cgi?addr=xxx.xxx.xxx.xxx

(x's are the IP)

#123417 23/06/05 06:24 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
true enough that though you may find the "manager" it wouldn't tell you where the User is from.

with this:
http://www.saliu.com/cgi/IPtoDNS.cgi?addr=xxx.xxx.xxx.xxx

I did not do any error handling for IP address only, maybe you could incorporate that in?

#123418 02/08/05 06:01 PM
Joined: Feb 2005
Posts: 344
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Feb 2005
Posts: 344
how do i put this in a whois reply ?

#123419 31/08/05 07:15 AM
Joined: May 2005
Posts: 106
S
Vogon poet
Offline
Vogon poet
S
Joined: May 2005
Posts: 106
why not have a script which when some one joins it echos there nickname and then there ip and then where they are from and log it

wink


and thats the way the scout leader burns

Link Copied to Clipboard