开发者

Get WHOIS "descr" value from IP address and insert into HTML table

I am using an SQL query to extract web statistics from my website. This is done with the MySQL comand line tool and outputted as a HTML table.

The table is currently formatted like this:

<TABLE>
<TR><TH>Keyword</TH><TH>Date</TH><TH>IP/WHOIS</TH></TR>
<TR><TD>random phrase</TD><TD>2010-10-11</TD><TD>1.2.3.4</TD></TR>
</TABLE>

The table is then refined with a VBS script and mailed to specified recpients with another VBS script.

What I would like to do is include some so开发者_如何学Pythonrt of script that takes the IP address and makes a WHOIS lookup and returns the value contained in the "descr" field. The value could go into the same cell as the IP or a completely new column. The script should be able to execute via my "run.bat" file which is connected to the task scheduler. The script doesn't necessarily have to be VBS, but needs to be able to run via the batch file.


What descr field are you talking about? WHOIS does not contain a DESCR or desciption field (see e.g. http://whois.domaintools.com/microsoft.com). EDIT: See comments below, it does contain a DESCR field.

There are many examples of VBS scripts querying readily available WHOIS services. If you want to use one of these public WHOIS services check for compliance with business use of the said service. It will get a lot harder when you try to query domain registries themselves, because you need to query different registrars for different IPs (e.g. you will not find an Icelandic (.is) domain within the German (.de) domain registrar's database (www.denic.de).

Try this google search for examples of querying WHOIS servers via VBS.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜