Created
October 30, 2015 14:07
-
-
Save avtomat2023/53a72935f70a581d9c12 to your computer and use it in GitHub Desktop.
View location of Ingress intel map in google map.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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