Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save manjeshpv/1f1c78c5c6498a922a3ef21d5e1d31d8 to your computer and use it in GitHub Desktop.
Save manjeshpv/1f1c78c5c6498a922a3ef21d5e1d31d8 to your computer and use it in GitHub Desktop.
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();
@manjeshpv
Copy link
Author

npm init
npm i axios --save
nano converter.js
node converter.js

@bhavinpatel07
Copy link

any way to do with rest API like php or http?

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