Created
July 7, 2009 15:48
-
-
Save 2bj/142169 to your computer and use it in GitHub Desktop.
bash implementation of http://www.domain.kg/whois.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# bash implementation of http://www.domain.kg/whois.html | |
# @author 2bj (gml2bj gmail) | |
if [ $# -eq 0 ]; then | |
echo "pls, give me domain (*.kg)" | |
exit 1 | |
fi | |
DOMAIN=`echo $1 | tr '[:lower:]' '[:upper:]'` | |
curl -s -A Firefox -e "http://www.domain.kg/whois.html" -d whois=$DOMAIN http://www.domain.kg/cgi-bin/whois.cgi | iconv -f cp1251 -t utf8 | awk 'BEGIN {l=0} | |
{ | |
if($0~"<pre") {l=1} | |
if(l==1) {print $0} | |
if($0~"</pre") {l=0} | |
}' | sed '/<pre/d;/<\/pre/d;s/<[^>]*>//g' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment