From 2bdc99582537d6cd1fdedc0ea0a10073e27f4f17 Mon Sep 17 00:00:00 2001 From: Samer Albahra Date: Fri, 3 Jul 2015 14:17:40 -0500 Subject: [PATCH] Fix incorrect variable definitions --- routes/weather.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/routes/weather.js b/routes/weather.js index ed1b6b8..cf2e0e2 100644 --- a/routes/weather.js +++ b/routes/weather.js @@ -65,9 +65,9 @@ function getWeatherUndergroundData( location, weatherUndergroundKey, callback ) // Perform the HTTP request to retrieve the weather data httpRequest( url, function( data ) { try { - var data = JSON.parse( data ), + data = JSON.parse( data ); - tzOffset = getTimezone( data.current_observation.local_tz_offset, "minutes" ), + var tzOffset = getTimezone( data.current_observation.local_tz_offset, "minutes" ), // Calculate sunrise and sunset since Weather Underground does not provide it sunData = SunCalc.getTimes( data.current_observation.local_epoch * 1000, @@ -117,8 +117,9 @@ function getWeatherData( location, callback ) { httpRequest( url, function( data ) { try { - var data = JSON.parse( data ), - weather = { + data = JSON.parse( data ); + + var weather = { iconCode: data.observation.icon_code, timezone: data.observation.obs_time_local, sunrise: parseDayTime( data.observation.sunrise ),