How to use the api in a dos style batch file

Questions about hostip.info remote GET support.

Moderator: Moderators

How to use the api in a dos style batch file

Postby markrecob on Sat May 19, 2007 10:59 am

What I ultimately want to do is run the batch file on a text file of IP addresses and look them all up for hostname and location. I have the hostname part working and am looking for a solution to the location. I found this batch code on some site but have been unable to make it work.
@echo off
setlocal
set Name:=
set Address:=
for /f "tokens=1,2" %%A in ('nslookup %1') do set %%A=%%B
echo %Name:% %Address:%
echo get /api/get.html?ip=%Address:% | nc www.hostip.info 80
endlocal

I installed netcat so nc is working fine. I have experimented with many variations of the "echo get /api/get.html?ip=%Address:% | nc www.hostip.info 80" line since it appears different from the examples on the site ("echo get /api/get_html.php?ip=%Address:% | nc api.hostip.info 80" for instance. Nothing works. nc opens the port but it doesnt seem to pass the parameters so after a minute it just times out. Can anyone help? Thank you.
markrecob
n00b
 
Posts: 1
Joined: Sat May 19, 2007 8:22 am
Location: Sunnyvale, CA

Return to Hostip.info remote GET/PHP support

Who is online

Users browsing this forum: No registered users and 2 guests

cron