summary refs log tree commit diff
diff options
context:
space:
mode:
authorBaitinq <30861839+Baitinq@users.noreply.github.com>2019-08-31 18:55:00 +0200
committerGitHub <noreply@github.com>2019-08-31 18:55:00 +0200
commit3ef45aa979beb4bfad32755b05ba1b301ad2ab49 (patch)
treefd330137072157b2625fe046bfde957015befc34
parentFormatting (diff)
downloadgeolocate-3ef45aa979beb4bfad32755b05ba1b301ad2ab49.tar.gz
geolocate-3ef45aa979beb4bfad32755b05ba1b301ad2ab49.tar.bz2
geolocate-3ef45aa979beb4bfad32755b05ba1b301ad2ab49.zip
Changed api HEAD master
-rwxr-xr-xgeolocate12
1 files changed, 6 insertions, 6 deletions
diff --git a/geolocate b/geolocate
index 85af634..258f872 100755
--- a/geolocate
+++ b/geolocate
@@ -34,8 +34,8 @@ getIp() {
 }
 
 getCoord() {
-curl -s https://ipvigilante.com/ | \
-        jq '.data.latitude, .data.longitude' | \
+curl -s http://ip-api.com/json | \
+        jq '.lat, .lon' | \
         while read -r LATITUDE; do
                 read -r LONGITUDE
                 echo "${LATITUDE}:${LONGITUDE}" | tr -d '"'
@@ -43,8 +43,8 @@ curl -s https://ipvigilante.com/ | \
 }
 
 printCoord() {
-curl -s https://ipvigilante.com/ | \
-        jq '.data.latitude, .data.longitude' | \
+curl -s http://ip-api.com/json | \
+	jq '.lat, .lon' | \
         while read -r LATITUDE; do
                 read -r LONGITUDE
                 echo "${LATITUDE}:${LONGITUDE}" | tr -d '"' > /usr/share/geolocate/.location
@@ -70,8 +70,8 @@ curl -s https://ipvigilante.com/ | \
                       ;;
                   *)
                       IP="$2"
-                      curl -s https://ipvigilante.com/$IP | \
-                              jq '.data.latitude, .data.longitude' | \
+                      curl -s http://ip-api.com/json/$IP | \
+	        	      jq '.lat, .lon' | \
                               while read -r LATITUDE; do
                                       read -r LONGITUDE
                                       echo "${LATITUDE}:${LONGITUDE}" | tr -d '"'