This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Announce: IP Location script

Support & discussion of released scripts, and announcements of new releases.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Announce: IP Location script

Post by rosc2112 »

Something I whipped up a while ago in about an hour (most of which was just trying to figure out how to set POST queries for geobyte's site. I eventually cheated and just used lynx to see what was being submitted ;) )

This script will take an IP or hostname and look up their location data from anti-online.com or geobytes.com. Keep in mind, both sites impose a quota/usage limit..

If anyone knows of a *good* IP-Locator site that does not impose such a limit, let me know (I looked at quite a few other sites, and they either did not meet my needs, did not accept a hostname ((yes I know I could do the hostname lookup myself first..but I'm lazy :P )) or their data was so wildly inaccurate as to be all but useless..) So, the emphasis is on *good* IP-Locator ;)

http://members.dandy.net/~fbn/iplocator.tcl.txt

Also uploaded to archives.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

why use websites?

do your own whois lookup, it's trivial
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

whois is one source that the databases use, but it's not always indicative of actual location. The IP location websites use a few different sources of data (of course, there's no way to obtain "100%" accuracy.)
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

right, but continuous use of their resources in an automated fashion will eventually get you banned; these guys sell their stuff and will hardly tolerate leechers

on the other hand, WHOIS servers like that of ARIN and regional authorities don't impose usage limits, while still providing most of the information you get from (demo versions of) commercial "IP locator" services
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

First of all, I have not abused their websites. I've used the script myself perhaps half dozen times over the last 2 months. Second, if you don't like the script, don't use it.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

I use a very well written IP checking script (ipcheck by arfer) that accesses the very free www.dnsstuff.com for varying information.
Named to PCMag.com Top 100 Sites for 2005, Computing Category. This site has many DNS, networking, and domain registration tools for network administrators, domain owners, users of hosted DNS services, etc. There is no cost for using this site. You are free to link to this site.
No (apparent) fear of being banned &c.

rosc2112: I think demond's point is that your script could cause a problem for a user (you only used it a few times) if made freely available to users in a busy channel. The script I use is also used in a busy DALnet channel and it is triggered almost every 10 minutes (or less).
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I appreciate that, and thank you for the other script Alchera, I'll check it out. The script I made does handle when the server gives you the "exceeded quota" message, and there's a note in the script about there being a use-quota, so it's up to the script user to restrict the bind for ops only, if they want, or the users will prolly quickly use up the the allowance. I'd thought about using dnstuff's site as well, but being lazy... :)

If ipcheck does what I need, I'll prolly use that instead (or addition) to mine.
User avatar
kash2k
Voice
Posts: 18
Joined: Fri Aug 25, 2006 10:45 pm
Location: India

Post by kash2k »

My IP locator scripts gives me an error :--

[07:51] Tcl error [iplocator]: can't read "page": no such variable

Restarted the bot.. Same Issue...Please gimme a simple TCL If you have
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Post output of .set errorInfo

Edit:
The error you received generally indicates that the script was not able to connect to the website(s), but there should have been an error returned by the script, not just a tcl error about var "page" not being defined. You can add

set page ""

before the lines with

catch {set page

and/or check the content of the $error variable by putting

putcmdlog "error $error"

after the "catch {set page" lines.

I suppose there is an error condition that I'm not aware of and did not test for. But since my copy of the script does not produce the error, I cannot debug it for you without further details.
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Just a note about that ipcheck script Alchera mentioned, it does not close the socket when it's finished pulling data. I sent a note to the author about it. Also suggested grabbing whois data for nick lookups, since getchanhost doesn't play well with servers that have +x modes (does not recognize when a user sets mode -x to reveal ip, unless user parts/rejoins)
Other than that it looked pretty good =)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

The script has been fixed and uploaded (link as posted earlier).

As for users that set mode +/-x on those bloated networks; that is the intention: Stop any user from gleaning any information about their host, only an IRCOp can see the real host of a user with mode +x.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

I realize that, was just pointing out if I set my mode -x to show my ip, the script ([getchanhost]) does not recognize the change.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

rosc2112 wrote:I realize that, was just pointing out if I set my mode -x to show my ip, the script ([getchanhost]) does not recognize the change.
It does after you cycle the channel. This is nothing to do with eggdrop.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

[getchanhost] is an eggdrop command isn't it? I'd already mentioned if the user parts/joins the channel, [getchanhost] then recognizes the fact that the ip is now revealed. Might help if you'd read the posts rather than just criticize.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Even an IRC client doesn't see the updated host when the mode is changed unless the channel is cycled.

It appears to not be an eggdrop problem.

Possibly there is information in the Bugs Archives.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Post Reply