From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <3aaafc130906051901i4950eefcje109d2aca5f8e1a2@mail.gmail.com> References: <3aaafc130906051901i4950eefcje109d2aca5f8e1a2@mail.gmail.com> Date: Fri, 5 Jun 2009 23:14:31 -0400 Message-ID: <3aaafc130906052014m6fafdaeajc40866e714a3312@mail.gmail.com> From: "J.R. Mauro" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] geoloc - a crappy script I wrote. Topicbox-Message-UUID: 05e66828-ead5-11e9-9d60-3106f5b1d025 On Fri, Jun 5, 2009 at 10:01 PM, J.R. Mauro wrote: > generally useful besides a gmap helper, I suppose. I'm trying to see > if I can get something like google maps directions based on geoloc > since the yahoo site it uses seems to not fail if you give it a very > vague address, unlike most other services I've tried. I suppose I > could try to see if I can get a barebones access to google maps > directions. Like an XML page or something. If anyone knows how, I'd > appreciate some pointers. Here's a hack on top of my hack. The real suckage comes from me making geoloc separate lat and lon with '?' to appease gmap. It's a small change if you don't like it. I really want subway directions, but apparently Yahoo can't do that. I'll keep digging. #!/bin/rc # directions -- print directions from a coordinate pair to another. if (! ~ $#* 2) { echo Usage: directions lat1?lon1 lat2?lon2 exit } SLA = `{echo $1 | sed -e 's/\?.*//'} SLO = `{echo $1 | sed -e 's/.*\?//'} DLA = `{echo $2 | sed -e 's/\?.*//'} DLO = `{echo $2 | sed -e 's/.*\?//'} #echo I got: $SLA $SLO $DLA $DLO hget 'http://maps.yahoo.com/print?mvt=m&tp=1&stx=&fcat=&frat=&clat='^$DLA^'&clon='^$DLO^'&mag=10&zoom=9&trf=0&radius=134.16445&&q1='$SLA'%20'^$SLO^'&q2='^$DLA^'%20'^$DLO^'&v3=0' | htmlfmt