Skip to content

Instantly share code, notes, and snippets.

@thany
Last active April 28, 2021 09:05
Show Gist options
  • Save thany/a21281f2d9847d1c94c8c9d8a2447968 to your computer and use it in GitHub Desktop.
Save thany/a21281f2d9847d1c94c8c9d8a2447968 to your computer and use it in GitHub Desktop.
Get Denso Mapcode from Denso server using a bash command
wget http://post.denso-communications.jp/dn/navicon_start.php --method=POST --body-data="lat=35.872722875676274&lng=139.73869658316153" -O - -q | grep -Po '(?<=id="mapcode">)([^<]*)'
@thany
Copy link
Author

thany commented Aug 28, 2019

Disclaimer

Denso Co Ltd keep for themselves how to generate these codes, so using their server seems okay to me. Denso Mapcodes are widely used in Japan, especially in car satnavs, so obtaining mapcodes ought to be as free as free speech. Well, it bloody sure isn't. I understand that Japanese businesses do not yet fully understand the appeal of being open, so I suppose scripting it is the next best thing. They don't even provide the simplest of API's, so the second-best thing would be to scrape a webpage they return when requesting a code. And this command does exactly that.

References

https://en.wikipedia.org/wiki/Denso_mapcode
For more information on Denso Mapcode

Visually get mapcodes

http://japanmapcode.com/en
Does use its own proper JSON API, but since it's a personal project, I rather not "punish" him for Denso's fault of keeping everything a secret.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment