Skip to content

Instantly share code, notes, and snippets.

@avtomat2023
Created October 30, 2015 14:07
Show Gist options
  • Save avtomat2023/53a72935f70a581d9c12 to your computer and use it in GitHub Desktop.
Save avtomat2023/53a72935f70a581d9c12 to your computer and use it in GitHub Desktop.
View location of Ingress intel map in google map.
(require 's)
(defun ingress-location-to-google-map-location (loc)
(let ((match (s-match (concat "https://www.ingress.com/intel\\?"
"ll=\\([^,]+\\),\\([^,]+\\)&"
"z=\\([0-9]+\\)") loc)))
(and match
(let* ((lat (nth 1 match))
(lng (nth 2 match))
(zoom (nth 3 match)))
(concat "https://www.google.co.jp/maps/@" lat "," lng "," zoom "z")))))
(defun ingress-view-in-google-map (loc)
"View location of intel map in google map."
(interactive "sYank a link of intel map: ")
(let ((url (ingress-location-to-google-map-location loc)))
(if url
(browse-url url)
(message "Not a valid location."))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment