Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- echo 'Location:'
- if curl -s ipinfo.io/2.147.25.51?token=$TOKEN |grep -E 'country|region|city|loc' \
- |awk '{print $2}' > outfile; then
- sed 's/[",]/ /g' outfile | head -3 |tr -d '\n';
- echo '\nCoordinates:'
- tail -1 outfile |sed 's/[",]/ /g'
- fi
- # I need something similar written in python that would output Location: (Country, Region, City) and Coordinates: (Long, Lat)
Add Comment
Please, Sign In to add comment