Skip to content

Commit aa98927

Browse files
committed
change the geolocation provider once more
1 parent 8c8a2c8 commit aa98927

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ window.addEventListener('DOMContentLoaded', async () => {
2929
const apiKey = userApiKey || defaultApiKey;
3030

3131
// Getting current user location
32-
const geoLocation = 'http://ip-api.com/json/';
32+
const geoLocation = 'https://ipapi.co/json/';
3333
const locationData = await fetch(geoLocation);
3434
const parsedLocation = await locationData.json();
35-
const currentUserLocation = parsedLocation.query;
35+
const currentUserLocation = parsedLocation.ip;
3636

3737
const weatherApi = `https://api.weatherapi.com/v1/current.json?key=${apiKey}&q=${currentUserLocation}&aqi=no`;
3838

0 commit comments

Comments
 (0)