Video 32
This commit is contained in:
parent
69b5557f0f
commit
1483a6c456
@ -1,8 +1,7 @@
|
||||
const request = require('request')
|
||||
|
||||
const url = 'https://api.darksky.net/forecast/0466bccb953c0b9daeb091a529da2c0d/37.8267,-122.4233'
|
||||
const url = 'https://api.darksky.net/forecast/0466bccb953c0b9daeb091a529da2c0d/37.8267,-122.4233?units=si'
|
||||
|
||||
request({ url: url }, (error, response) => {
|
||||
const data = JSON.parse(response.body)
|
||||
console.log(data.currently)
|
||||
request({ url: url, json: true }, (error, response) => {
|
||||
console.log(response.body.daily.data[0].summary + ' It is currently ' + response.body.currently.temperature + ' degrees out. There is a ' + response.body.currently.precipProbability + '% chance of rain.')
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user