1
0
This commit is contained in:
Jason Williams 2019-08-23 15:45:29 -06:00
parent 69b5557f0f
commit 1483a6c456

View File

@ -1,8 +1,7 @@
const request = require('request') 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) => { request({ url: url, json: true }, (error, response) => {
const data = JSON.parse(response.body) 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.')
console.log(data.currently)
}) })