Created
June 3, 2018 19:11
-
-
Save ingorichter/c619c447650b1097e99daab66a654ca5 to your computer and use it in GitHub Desktop.
Extract business location JSON from impossiblefoods.js
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
curl https://www.impossiblefoods.com/scripts/main.js | tr '\n' '\a' | grep -o "e.exports=\[{geometry:.*\"}}]},{}\]," | sed "s/e.exports=//" | sed "s/},{}],//" | sed "s/\([a-zA-Z]*\):/\"\1\":/g" | sed "s/\"\"https\"/\"https/g" | sed "s/\"ext\":/ext:/" | sed "s/\"coordinates\":\[,\]/\"coordinates\":\[0,0\]/g" | tr -d '\a' > result.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment