119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 11:49 AM
WHATS MY IP
Whats my IP will simply give you your routers IP address.
Imagine your on your private FTB server and your friend asks you, hey, whats the IP, you could just pop on your ComputerCraft computer and find out.How it works:It uses a PHP script that is on my website which returns your IP.
If you want you can tap into it and use it in your own scripts and programs to find out your users IPs.
The script is at: http://mitchfizz05.net/getip.php. It will simply return your IP address nothing else.Download:Run "pastebin get XpXM7xQy whatsmyip"Or click the pastebin ID to view the code on pastebin and copy it into a file.Thanks, I hope you like :)/>To prove this works:Goto whatsmyip.com or ipchicken.com and check your IP there; then match that up with my program.
107 posts
Posted 08 July 2013 - 11:56 AM
Not bad… can you alter how it obtains the IP so you can choose a different source?
799 posts
Location
Land of Meh
Posted 08 July 2013 - 12:10 PM
Nice, but this won't work on servers, only on single player. In CC, HTTP requests aren't sent from the client (from your computer) while on a server, but from the server itself, meaning the IP shown will be the server's, not your own. It's not possible to obtain the client's IP address while on a server in CC for this reason. This design of course makes sense, as what if multiple people were using the CC computer? How would CC know which client should send the request?
119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 12:11 PM
Not bad… can you alter how it obtains the IP so you can choose a different source?
Why would you do that?
If your getting confused…
It obtains YOUR IP, not my websites IP. There would be completely no reason to get your IP from a different source unless my website was down.
107 posts
Posted 08 July 2013 - 12:11 PM
Very true GravityScore… good point.
EDIT: That's what I mean… if your site is down or should I want to use a different method of obtaining the IP is it possible with a few simple modifications to the program?
119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 12:13 PM
Nice, but this won't work on servers, only on single player. In CC, HTTP requests aren't sent from the client (from your computer) while on a server, but from the server itself, meaning the IP shown will be the server's, not your own. It's not possible to obtain the client's IP address while on a server in CC for this reason. This design of course makes sense, as what if multiple people were using the CC computer? How would CC know which client should send the request?
True, but there isn't much I can do about that. =\
119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 12:16 PM
Very true GravityScore… good point.
EDIT: That's what I mean… if your site is down or should I want to use a different method of obtaining the IP is it possible with a few simple modifications to the program?
Yes it is possible, you just need a script that returns your IP address. I could make a mirror… but my site is rarely down.
107 posts
Posted 08 July 2013 - 12:21 PM
Cool :)/> My biggest concern when it comes to dependencies is reputation. Example… I commented on a program that stores your programs on a server database rather than pastebin. The comment was aimed at whether or not it could be changed to be other servers or why even both when pastebin is VERY reliable. I look to find a long term answer for things like that…
119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 12:32 PM
Cool :)/> My biggest concern when it comes to dependencies is reputation. Example… I commented on a program that stores your programs on a server database rather than pastebin. The comment was aimed at whether or not it could be changed to be other servers or why even both when pastebin is VERY reliable. I look to find a long term answer for things like that…
Well I
'm almost certain that I won't take down that script, but I can tell you that there is a slim chance that it will be down tempoarily on next year (2014) on the 29th of May (that's when my domain expires). I'll probably renew before then though.
107 posts
Posted 08 July 2013 - 12:33 PM
:-p Life happens just remember that ;-)
808 posts
Posted 08 July 2013 - 12:37 PM
Could just remove all the crap surrounding the ip address in the html returned by whatsmyip.net. That way all concerns are no more.
119 posts
Location
Adelaide, Australia
Posted 08 July 2013 - 12:48 PM
Could just remove all the crap surrounding the ip address in the html returned by whatsmyip.net. That way all concerns are no more.
I've looked at that but in the source code of whats my IP when I found this:
Please DO NOT program a bot to use this site to grab your IPs. It kills my server and thats not nice. Just get some cheap or free web hosting and make your own IP-only page to power your bot. Then you won't even have to parse any html, just load the IP directly - better for everyone!!
So I thought I'd be nice and make my own script.
Besides, I like to make programs for the challenge, to see if I can do it, so I wanted to make a PHP script to do it.