[Script] Place URL and telephone formatter (AU/DR/MX/IE/CY/GR only)

This script is super basic, but hopefully helpful for those creating places regularly in Waze Map Editor (WME).

The script is designed to do the following:

  • Formal all URLs so the protocol is stripped and URL is sanitised (including removal of UTM tags and tracking tails). The user has the option to strip or retain the protocol, along with stripping or retaining the www.

  • Formal all phone numbers so they are presented in the required format dependant on the country selected (i.e. +61 1 2345 6789, +18295551234, +52 12 3456 7890, etc.)

  • The script’s function can be switched on and off using a toggle switch at the top of the More Info tab when creating a new place (see images below).

  • The script currently supports Australia, the Dominican Republic, Mexico, Ireland, Cyprus and Greece (+61 / +1 (809/829/840/800/888/877/866/855/844/833/822/900 area codes/toll free/premium) / +52 / +353 / +357 / +30).

Download: https://greasyfork.org/scripts/564120

Changelog:

  • 1.6.9 - Added support for Greece, Cyprus and Ireland.
  • 1.6.1 - Added new functionality to the website field that allows you to turn on/off protocol and www sanitisation. This applies regardless of region selected.
  • 1.5.5 - Now includes support for Mexico phone numbers
  • 1.5.4 - Included further URL sanitisation by removing UTM tags and tracking tails. Removed spaces from DR phone numbers.
  • 1.5.3 - Added support for Australian 1300, 13, 1800, 1900 numbers.
  • 1.5.2 - Support for Dominican Republic added.
  • 1.4.2 - Original version of script with bug fixes implemented. Works for AU only.

You’ll know the script has formatted your text and phone number because the ‘i’ icon will change to a green tick to indicate success.

Examples:

  • If a user pastes “https://www.geelongaustralia.com.au/parks/item/13thbeach.aspx?utm=google&source=search” and has selected the protocol stripping function, it will format the URL as “www.geelongaustralia.com.au/parks/item/13thbeach.aspx”

  • If a user pastes a phone number as “03 5244 5888”, it will format this number as “+61 3 5244 5888”, likewise for DR, MX, IE, CY and GR, if they paste a phone number as “829 555 1235”, it will format this number as “+18295551235” and “5545331233” to “+52 55 4533 1233”, etc.

    • Phone number formatting works for all landline and cell numbers.

    • Number formatting for Australia, Mexico, Ireland, Greece and Cyprus includes spaces, while number formatting for DR excludes spaces.

Limitations/notes:

  • Everybody is welcome to use this script, but the phone number formatting function only works for Australian, the Dominican Republic, Mexico, Ireland, Greece and Cyprus phone numbers. It won’t format international phone numbers outside of these three countries.

Images:

3 Likes

Hi.

Could you add Dominican Republic? Our format is +18x9xxxxxxx (+1 followed by ten digits)

2 Likes

Sure thing, let me do some research on DR phone number formats and look at how I can implement a drop-down box to refine the logic. Will have a play with this later today.

2 Likes

Just deployed a new version of the script with DR functionality added.

I’ve tested it on a few known DR phone numbers, but it could be worth triple checking the functionality before fully relying on it.

2 Likes

Things are looking great, except we don’t use spaces.

2 Likes

That should be super easy to fix :slight_smile: just checking your number format is typically just a full set of digits with no spaces or hyphens?

Yes, that’s the standard we recently adopted for phone numbers in the WME: +1 followed by 10 digits, no spaces or hyphens whatsoever.

Example: +18093272456

2 Likes

Cool - I’ll work on that. I’m also going to update the script to strip UTM tags. Often when you copy a website URL from a Google place listing it retains UTM tags and it can be annoying to strip and sanitise those.

2 Likes

That should be all sorted now as of version 1.5.4. I’ve updated the script to strip UTM tags and tracking tails when pasted and also changed the DR phone validation to remove spaces and hyphens :slight_smile:

2 Likes

Would you please add Mexico format?

+52 XX XXXX XXXX

Thanks on advance

2 Likes

I think that’s definitely possible. In terms of the WME localisation for Mexico - is it in the format you have shown here (with spaces)?

Working great now. I shared the script with the dominican community,

Thx!!!

2 Likes

Amazing - thanks for your support!

Yes please :folded_hands:t3:

2 Likes

No problems - this is all done now. The latest version (1.5.5) now includes support for Mexico. Let me know if you run into any issues.

2 Likes

I have made some proofs and it is working ok!!

thank you!! :blush:

2 Likes

Awesome, that’s great news!

Why would you remove the Protocol and keep the www?

Our guidance in Ireland is to include the protocol and exclude the “www”. Could the URL function be localised too?

1 Like

Good question. For Australia we drop the protocol but retain the www.

I think there could be an easier way rather than something specific for each location. I’ll look at including a tick box near the website field that allows you to include/exclude either/or the protocol or the www.

Will have a play with it and let you know how I go.

Just updated to version 1.6.1. It now has functionality that allows the user to choose how their URL is sanitised. You can turn http:// and https:// on/off, along with www on/off or any combination of both.