-
Notifications
You must be signed in to change notification settings - Fork 7
Client
Top Dog edited this page Apr 5, 2019
·
42 revisions
new Client(auth, debug)
- Auth Object containing authentication information. (Object)
- Debug Function to log debugging information to. (Function)
An object containing authentication information (Object)
- username The username that was used to login. (String)
- password The password that was used to login (String)
Function to log debug information. (Function)
The login session of the user in the client. (Session)
Create session and access token to make authorized requests. Returns Promise<>
Client.login().then(() => {
});
Client.getProject(10128407).then(project => {
console.log("The project " + project.title + " was made by " + project.author.username);
});
/*
The project Paper Minecraft v11.3 (Minecraft 2D) was made by griffpatch
*/
Get the amount of projects on scratch. Returns Promise<Number>
Client.getProjectCount().then(count => {
console.log("There are currently " + count + " projects on scratch");
});
/*
There are currently 40128703 projects on scratch
*/
Client.getUser("WO997").then(user => {
console.log("The user " + user.username + " is working on \n" + user.profile.status);
});
/*
The user WO997 is working on
Babylon.js, Android Studio
and Hill Climb Racing 3 - last scratch project
with @r2dav2 &@snow-cannon
If you're interested in starting working with 3D
https://scratch.mit.edu/projects/41231380/
*/
Client.getNews().then(news => {
console.log("The latest scratch news: " + news[0].title + "\n" + news[0].description);
});
/*
The latest scratch news: New Scratch Design Studio!
Create a project about a day in the life of something! This can be an animal, an object, a sup
erhero- anything you can imagine…
*/