diff --git a/Weather/weatherserver.js b/Weather/weatherserver.js index 487d3b3..810dedf 100644 --- a/Weather/weatherserver.js +++ b/Weather/weatherserver.js @@ -1,20 +1,16 @@ var Scratch = require('scratch-api'); var XMLHttpRequest = require('xhr2'); -var USERNAME = ''; -var PASSWORD = ''; var PROJECT_ID = -1; var API = 'http://api.openweathermap.org/data/2.5/weather?zip=02138,us&units=imperial&APPID={appid}'; var cloud; -Scratch.createUserSession(USERNAME,PASSWORD, function(e,user){ +Scratch.UserSession.load(function(e,user){ if (e) return console.error(e); - user.cloud(PROJECT_ID, function(e, cloud_){ + user.cloudSession(PROJECT_ID, function(e, cloud_){ if (e) return console.error(e); cloud = cloud_; - cloud.connect(function(){ - weatherserver(); - }); + weatherserver(); }); });