Forked from manjeshpv/google-map-short-url-to-geo-co-ordinates.js
Created
April 18, 2023 10:35
-
-
Save anujsinghwd/d0db8ed0d68e21eb1f33eec97eb58775 to your computer and use it in GitHub Desktop.
This file contains 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
const axios = require('axios'); | |
const fs = require('fs'); | |
const process = async () => { | |
const response = await axios.get('https://goo.gl/maps/29XfoqKK5s7UdaSy8'); | |
const expression = /window.APP_INITIALIZATION_STATE=\[\[\[\d+.\d+,(\d+.\d+),(\d+.\d+)/ | |
const [,lat, long] = response.data.match(expression)[0].split('[[[')[1].split(',') | |
console.log({ lat, long}) | |
return { lat, long}; | |
} | |
process(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment