Skip to content

Commit 30bd4a3

Browse files
committed
modified: public/README.md
1 parent bd69a99 commit 30bd4a3

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

public/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ To obtain the pinpoint weather data, earth location is a required parameter. Fo
99
Sample code for client-side geolocation:
1010

1111
```c
12+
<p id="geo-coord"></p>
13+
1214
<script type=javascript>
1315
if (navigator.geolocation) {
1416
navigator.geolocation.getCurrentPosition(showPosition);
@@ -26,8 +28,8 @@ Sample code for client-side geolocation:
2628
```
2729
2830
* The API query for weather data can be describe as follow.
29-
30-
> <https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/${LOCATION}?unitGroup=metric&key=${API_ACCESS_KEY}&contentType=json>
31+
32+
> `https://api.weatherbit.io/v2.0/history/airquality?city=${LOCATION}&start_date=2022-10-03&end_date=2022-10-04&tz=local&key=${API_ACCESS_KEY}`
3133
3234
Where, **LOCATION** can be City, State
3335
@@ -39,7 +41,7 @@ Sample code for client-side geolocation:
3941
4042
# Getting Real Data from A Paid API Provider
4143
42-
Replace freecodecamp proxy URI (file: public/scripts.js) for weather data provider via a paid subscription. In this project, you can use the API service from the [VisualCrossing.com](https://www.visualcrossing.com). The good news is if you registered to use the free tier, a good fit for demonstration purposes, there is no charge as long as you stay within the allowed call limit. Read [here](https://www.visualcrossing.com/resources/blog/five-easy-weather-api-calls-to-get-the-weather-data-you-need/) to learn ways to make weather API calls.
44+
Replace freecodecamp proxy URI (file: public/scripts.js) for weather data provider via a paid subscription. In this project, you can use the API service from the [weatherbit.io](https://api.weatherbit.io/v2.0/). The good news is no credit card is required (at the time I develop this app). You registered to use the free tier, and there is no charge as long as you stay within the allowed call limit of 1500 calls/day. You will get errorCode 429 when you'd reached the limit. Read [here](https://www.weatherbit.io/faq) to learn ways to make weather API calls.
4345
4446
<br />
4547
@@ -238,7 +240,7 @@ When you exceed a daily limit (calls per day) the API will return an HTTP 429 er
238240
239241
<strong><span style="color:gray; font-size:18px">Caching the Weather Data</span></strong>
240242
241-
Weather forecast data from `visualcrossing.com` typically contains information spanning 15 days, each day contains 24 hourly objects. Additional queries within the same period would usually result in the same data. We need to cache this information so as not to incur needless and sometimes costly API calls.
243+
Weather forecast data from `weatherbit.io` typically contains information spanning 15 days, each day contains 24 hourly objects. Additional queries within the same period would usually result in the same data. We need to cache this information so as not to incur needless and sometimes costly API calls.
242244
243245
We could elect to use the DOM Storage API, also called the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API/Using_the_Web_Storage_API) methods: `Window.sessionStorage` where data persists as long as the session is running, or `Window.localStorage` which has no expiration. Note: when the last private tab is closed, data stored in the localStorage object of a site opened in a private tab or incognito mode is cleared.
244246

0 commit comments

Comments
 (0)