It snowed and you got no Emails

Marc MERLIN marc at merlins.org
Mon Sep 30 14:21:13 PDT 2019


On Mon, Sep 30, 2019 at 09:55:28AM -0700, Marc MERLIN wrote:
> For the caltrans site, seems that they silently moved their roadinfo to
> https://roads.dot.ca.gov/ 
> The way to query it and parse it is a bit different. I'll work on it and
> make it work soon.

I wrote new code to support the new website and tested it. It seems to
work, so I just made it live.

If you speak unix, the new way to get caltrans info is:
wget -O - --post-data="roadnumber=$road" https://roads.dot.ca.gov/ 2>/dev/null | sed -e '1,/\/h3/ d' -e "/^<hr/,$ d" | lynx -stdin -dump | tr '\012\015' '| ' | sed "s/| *|/@/g" | tr '|@' ' \012' | sed -e "s/^ *//" -e "s/  */ /g"

Who needs hundreds of line of code when one line of unix shell will do :)

Cheers,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  



More information about the Tahoeroads mailing list