Latrina

Untitled

Mar 17th, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.39 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. echo 'Location:'
  4. if curl -s ipinfo.io/2.147.25.51?token=$TOKEN |grep -E 'country|region|city|loc' \
  5.     |awk '{print $2}' > outfile; then
  6.         sed 's/[",]/ /g' outfile | head -3  |tr -d '\n';
  7.             echo '\nCoordinates:'
  8.         tail -1 outfile |sed 's/[",]/ /g'
  9. fi
  10.  
  11. # 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