Skip to content

Instantly share code, notes, and snippets.

@assafmo
Last active January 3, 2019 12:48
Show Gist options
  • Save assafmo/93175f40cab07c2e72deb9ba042951e6 to your computer and use it in GitHub Desktop.
Save assafmo/93175f40cab07c2e72deb9ba042951e6 to your computer and use it in GitHub Desktop.
Check if google street view is available for GPS coordinates (radius 100m)
#!/bin/sh
lat=$1
long=$2
ans=$(curl "https://maps.googleapis.com/maps/api/js/GeoPhotoService.SingleImageSearch?pb=!1m5!1sapiv3!5sUS!11m2!1m1!1b0!2m4!1m2!3d$lat!4d$long!2d100!3m18!2m2!1sen!2sUS!9m1!1e2!11m12!1m3!1e2!2b1!3e2!1m3!1e3!2b1!3e2!1m3!1e10!2b1!3e2!4m6!1e1!1e2!1e3!1e4!1e8!1e6&callback=_xdc_._2kz7bz" \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/59.0.3071.109 Chrome/59.0.3071.109 Safari/537.36' \
-s --compressed | \
grep -o "Search returned no images")
if [[ -z "$ans" ]]; then
echo true
exit 0
fi
echo false
exit 1
@assafmo
Copy link
Author

assafmo commented Jan 14, 2018

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