On Wed, May 29, 2002 at 04:16:22PM -0400, Ross Wm. Rader wrote:
> 
> If predictability is highly valued, then I'd like to hear more...

$ for i in `jot 10 0`; do echo -n " $i - " ; whois enom.com | grep -i '13:45' ; done
 0 - Registered through- Sun Sep 21 2003 13:45:09
 1 - Expiration date: Sun Sep 21 2003 13:45:09
 2 - Expiration date: 09/21/03 13:45:09
 3 - Expires: Sun Sep 21 2003 13:45:09
 4 - Expires: 09/21/03 13:45:09
 5 - Registered through- 09/21/03 13:45:09
 6 - Expires: 09/21/03 13:45:09
 7 - Expires: Sun Sep 21 2003 13:45:09
 8 - Expires: 09/21/03 13:45:09
 9 - Expires: 09/21/03 13:45:09
$

See, this is just stupid.

Now, in order to gather expiry dates from Enom, I have to allocate all
of ten minutes to write a few extra lines of code.  Big whoop.  For all
the effort Enom has gone to in order to obfuscate expiry dates, they're
*still* in easily recognized formats.

Heck, in bourne shell, using /bin/date's implementation of strptime():

whois $enomdomain | egrep '^(Exp|Reg)i.*[:-] .*[0-9]' | sed -E 's/^[^:-][:-] //' | 
while read line ; do
        if echo "$line" | grep -q '^[0-9][0-9]/[0-9][0-9]/[0-9][0-9] ' ; then
                fmt='%m/%d/%y'
        elif echo "$line" | grep -q '^[A-Z][a-z][a-z] [A-Z][a-z][a-z] ' ; then
                fmt='%a %b %d %Y'
        elif echo "$line" | grep -q '^[0-9][0-9][0-9][0-9]-' ; then
                fmt='%Y-%m-%d'
        else
                fmt=""
        fi
        test -t 0 && echo "> fmt='$fmt' line='$line'"
        if [ -n "$fmt" ]; then
                date -jf "$fmt" "$line" '+%Y-%m-%d'
        fi
done


Ross, if I had a choice, I'd rather you fix the ticketing software than
devote any effort to obfuscating whois data.

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  Operations / Development / Abuse / Whatever       vox: +1 416 598-0000
  it.canada                                            http://www.it.ca/

Reply via email to