topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 11:58 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Alias: Google Maps Directions  (Read 29667 times)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Alias: Google Maps Directions
« on: July 17, 2008, 01:15 AM »
New Update:
thanks to the efforts of [user]herojoker[/user], this alias has become more flexible with the separators. now the queries can be separated by arrows with arbitrary length (>, ->, -->, --->, etc.), semi-colon and "lines" with arbitrary positive length >= 2 (--, ---, etc.).

also added is single location search as well as support for .dcupdate files where you can update future versions via DCUpdater.

if you had already downloaded the previous version. please delete the old alias in '\AliasGroups\MyCustom' and extract the new zip contents into '\AliasGroups\Installed' instead.

P.S. the icon is from the openPhone theme.

ws-gmaps-alias-new-1.png

« Last Edit: September 21, 2008, 10:54 PM by lanux128 »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #1 on: July 17, 2008, 02:35 AM »
nice  :up:

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #2 on: July 17, 2008, 03:23 AM »
I think that using the space as separator can be annoying if you have a town with a space in its name :)
Why don't you use the collon instead? (':')

[edit] lanux: you left the icon path there,but it isn't included in the default install of farr. I also found out that using an alias with a non-existing icon results in strange happenings :) [/edit]
« Last Edit: July 17, 2008, 03:27 AM by jgpaiva »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #3 on: July 17, 2008, 03:55 AM »
smart idea jgpaiva.
and it would be nice to have 2 aliases, so that one triggers on a regex with only 1 location, and the other with the : triggers directions between 2 areas.

regarding icons: ideally this would be packaged in a zip with alias and icon files :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #4 on: July 17, 2008, 06:53 AM »
yikes! you're right, jgpaiva. now one can't get directions from new york to new jersey. ;D but since colon requires pressing the Shift key, i'd just go with the semi-colon.

i've made the changes, please try the alias and regarding the icon i'll make the alias pack with the icon included in a day or two.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #5 on: July 17, 2008, 06:55 AM »
but since colon requires pressing the Shift key, i'd just go with the semi-colon.
The semi-colon also involves shift key here :P hihi

CWuestefeld

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,009
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #6 on: July 17, 2008, 08:09 AM »
That's pretty cool. Thanks, lanux128.  :Thmbsup:

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #7 on: July 17, 2008, 08:31 AM »
The semi-colon also involves shift key here :P hihi
same here ;D
this one is great Lanux :Thmbsup:
never did like getting going with googlemaps
Tom

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #8 on: July 17, 2008, 08:18 PM »
i'm glad that it's useful to you guys but i'm not sure how to make the separator key customisable. however if you want to tweak it yourself, just change the semi-colon in regex pattern section to a key you find easier to access. ;)

ws-gmaps-alias-1.png

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #9 on: September 11, 2008, 03:03 PM »
I hadnt really used googlemaps for a while I see they've much improved their printing options or I mean the quality, visually & the mini-maps relating to each step work much better,
but I really just wanted to say thanks again for this - it make the initial diving in there so much easier :up:

Tom

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #10 on: September 11, 2008, 05:55 PM »
Use (?:;) to let $$1 and $$2 contain the two locations.
Perhaps " -> " or ">" (without the "") are a good separators, too?
Here is a relatively robust regex:

^route \s*(.+?)\s*(?:(?:\-\>)|(?:\>))\s*(.+?)\s*$

It matches
route a -> b and route a > b with arbitrary many spaces between route, the first location, the arrow, the second location and the end of the line. Use $$1 and $$2 to access the locations!
« Last Edit: September 11, 2008, 06:21 PM by herojoker »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #11 on: September 12, 2008, 01:48 AM »
thanks herojoker. i'm planning to add Google Maps' search location item in addition to the current 'direction' alias. maybe i'll use your regex to beef up the 'direction' search. :Thmbsup:

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #12 on: September 12, 2008, 07:15 AM »
The following version does the same but is more compact:
^route \s*(.+?)\s*(?:\-?\>)\s*(.+?)\s*$

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #13 on: September 12, 2008, 06:09 PM »
hmm.. i was about to go with the one below so that either ->, > or ; can be the separator. so how can i fit this in the compact version?

^route \s*(.+?)\s*(?:(?:\-\>)|(?:\>)|(?:\;))\s*(.+?)\s*$

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #14 on: September 12, 2008, 08:32 PM »
^route \s*(.+?)\s*(?:(?:\-?\>)|(?:;))\s*(.+?)\s*$
should do it (but I have not tested it so much).

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #15 on: September 21, 2008, 01:06 PM »
I've added more separators:
^route \s*(.+?)\s*(?:(?:\-*\>)|,|\-{2,})\s*(.+?)\s*$

This supports arrows with arbitrary length (>, ->, -->, --->, etc.), comma and "lines" with arbitrary positive length >= 2 (--, ---, etc.).
Remember, that the first complete separator in the input is used.

\- may be replaced with - but this version is safer because in some constellations - can become part of a modifier.
« Last Edit: September 21, 2008, 09:33 PM by herojoker »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #16 on: September 21, 2008, 08:49 PM »
@herojoker: thanks again, i'm trying to add the .dcupdate function to this alias and then i'll modify the alias to use your regex, with semi-colon as well. ;)

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #17 on: September 21, 2008, 09:32 PM »
Cool  8)
With semicolon and (because I think the aforementioned "- issue" is not critical) without the \ before -:
^route \s*(.+?)\s*(?:(?:-*\>)|-{2,}|;|,)\s*(.+?)\s*$

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #18 on: September 21, 2008, 09:40 PM »
thanks but i think we have to leave out the comma because we need it for places like Paris, Texas.

herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Alias: Google Maps Directions
« Reply #19 on: September 22, 2008, 07:14 AM »
Good point!
^route \s*(.+?)\s*(?:(?:-*\>)|-{2,}|;)\s*(.+?)\s*$