From fedc9b86a5e45859071448d615a96fc0cfcfb134 Mon Sep 17 00:00:00 2001 From: Truman Kilen Date: Thu, 19 Nov 2015 02:18:54 +0000 Subject: [PATCH] Update to scratch-api version 1.1.0 --- Weather/weatherserver.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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(); }); });