How to use the api in a dos style batch file

Questions about 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
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 80

I installed netcat so nc is working fine. I have experimented with many variations of the "echo get /api/get.html?ip=%Address:% | nc 80" line since it appears different from the examples on the site ("echo get /api/get_html.php?ip=%Address:% | nc 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.
Posts: 1
Joined: Sat May 19, 2007 8:22 am
Location: Sunnyvale, CA

Return to remote GET/PHP support

Who is online

Users browsing this forum: No registered users and 1 guest