mIRC Homepage

Make post request, download page, process page...

Posted By: Ancyker

Make post request, download page, process page... - 28/04/04 06:25 AM

I want to make a thing that you can type /locate [user/ip/host] and it will download the info from http://www.geobytes.com/IpLocator.htm and echo out the info something like this:

# Checking nick 'NICKNAME' (127.0.0.1)
#
# Locating NICKNAME (127.0.0.1)...
#
# Location: City, State, Country
# Nationality Singular: American
# Nationality Plural: Americans
# Time Zone: GMT +05:00
# Does not appear to be a proxy
#
# Data integrity: 99% Certin

It's just for me and not to give out...and i think this would be easier then going to the web page, I know ill have to use sockets, which I suck at, so all i need is the send request and the actual downloading of the file, and maybe some tips, and i can do the rest of the code on my own, thanks
Posted By: ATMA

Re: Make post request, download page, process page - 28/04/04 10:29 AM

you can try and socket to geektool.com's whois tool its alot better then others and it can tell you very specific info if u need it just one problem is the confirm number you will have to come up w/ a way to figur that out ;/
Posted By: Ancyker

Re: Make post request, download page, process page - 29/04/04 06:05 AM

wtf? thats not even what i asked, I asked for a way to download the page
Posted By: Wolfie

Re: Make post request, download page, process page - 29/04/04 06:14 AM

he answered your question.. you need to use a socket.
Posted By: Ancyker

Re: Make post request, download page, process page - 29/04/04 07:16 AM

No he didnt!

Quote:
..."I know ill have to use sockets, which I suck at, so all i need is the send request and the actual downloading of the file"...
Posted By: slartibartfast

Re: Make post request, download page, process page - 29/04/04 12:44 PM

This is the request you tell the server.
Code:
 
POST /IpLocator.htm?GetLocation HTTP/1.1
Host: www.geobytes.com
Content-Length: 14

text=127.0.0.1
 


Note: Some webservers need more information than this, read up on the Hypertext Transfer Protocol and add them

Ok, anyways ...

POST is just post request, telling the server what page you want, and HTTP version.

Host is needed for 1.1, and the fact that most sites use that to redirect to the correct site (if they have many Domains on one IP/Computer)

Content-Length is the length in BYTES for the post data. (you can use $len to calculate this)

Note that the EMPTYLINE is needed (after Content-Length and before the postdata)

-----

Have fun...

PS: I haven't tested this, it should work.
But even if it doesn't work you should be able to fix it reading up on the protocol.
Posted By: Iori

Re: Make post request, download page, process page... - 29/04/04 03:23 PM

It might be worth considering that the site says "no_bots_pls" 20 times. (In html source)
© 2020 mIRC Discussion Forums