UPDATE: CMYIP

Thursday, November 29, 2012 Posted by Unknown
cmyip.com changed the way they encoded the numbers so I could no longer pull the ip address directly from the source code. Instead of trying to decode the htmlnumbers to ascii not only because its hard but they have it setup to change the encoding. So now, Grab the source code and feed it through w3m browser and dump it back out to the terminal then grep the IP Address.

http://pastie.org/5454850


#!/bin/bash
ip_addr=`curl -s http://cmyip.com | w3m -T text/html -dump | grep -o -E '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}'`
echo $ip_addr
Labels:

Post a Comment