9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "J.R. Mauro" <jrm8005@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] geoloc - a crappy script I wrote.
Date: Fri,  5 Jun 2009 23:14:31 -0400	[thread overview]
Message-ID: <3aaafc130906052014m6fafdaeajc40866e714a3312@mail.gmail.com> (raw)
In-Reply-To: <3aaafc130906051901i4950eefcje109d2aca5f8e1a2@mail.gmail.com>

On Fri, Jun 5, 2009 at 10:01 PM, J.R. Mauro<jrm8005@gmail.com> 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



      parent reply	other threads:[~2009-06-06  3:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-06  2:01 J.R. Mauro
2009-06-06  2:12 ` erik quanstrom
2009-06-06  2:29   ` J.R. Mauro
2009-06-06  3:14 ` J.R. Mauro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3aaafc130906052014m6fafdaeajc40866e714a3312@mail.gmail.com \
    --to=jrm8005@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).