From 3f9f3df53bdfdcc54fa0b3f13b5eeb65fcd17dcc Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Sat, 21 Nov 2015 14:00:55 -0600 Subject: [PATCH] Verify Google feedback is correct and use API key --- routes/weather.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes/weather.js b/routes/weather.js index 9c41368..87111ee 100644 --- a/routes/weather.js +++ b/routes/weather.js @@ -223,7 +223,7 @@ function getTimeData( location, callback ) { location[ 0 ], location[ 1 ], function( err, timezone ) { - if ( err ) { + if ( err || timezone.status !== "OK" ) { callback( false ); } else { timezone = ( timezone.rawOffset + timezone.dstOffset ) / 60; @@ -243,7 +243,8 @@ function getTimeData( location, callback ) { callback( weather ); } - } + }, + { key: process.env.GOOGLE_API_KEY } ); }