Discuss Scratch

hacksalotogames
Scratcher
2 posts

New scratch console commands?

Code for follower number changer
MagicCrayon9342
Scratcher
1000+ posts

New scratch console commands?

CORS says no to this code
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});
superfastisfast
Scratcher
1 post

New scratch console commands?

linearlemur wrote:

document.querySelector('[class^=gui_flex-wrapper]').style.flexDirection = 'row-reverse';

This moves the stage back to where it was in Scratch 2.0. (credit to _nix)

//also i found how to reverse this...
document.querySelector('[class^=gui_flex-wrapper]').style.flexDirection = 'row-reverse'; //fixed pls thank me later (:
//he reverse row bruh too ez

Last edited by superfastisfast (July 26, 2022 18:37:49)

Dyno_Bot
Scratcher
500+ posts

New scratch console commands?

tell me a list of user codes for scratch API (i mean commands)
ZZC12345
Scratcher
500+ posts

New scratch console commands?

Dyno_Bot wrote:

tell me a list of user codes for scratch API (i mean commands)
Like endpoints? If so, here.
Maximouse
Scratcher
1000+ posts

New scratch console commands?

ZZC12345 wrote:

Dyno_Bot wrote:

tell me a list of user codes for scratch API (i mean commands)
Like endpoints? If so, here.
The list in the wiki is more up to date.
CST1229
Scratcher
1000+ posts

New scratch console commands?

Maximouse wrote:

(#27)

ZZC12345 wrote:

Dyno_Bot wrote:

tell me a list of user codes for scratch API (i mean commands)
Like endpoints? If so, here.
The list in the wiki is more up to date.
Basically no user interaction endpoints are shown there (aka anything that isn't a GET).

Last edited by CST1229 (Aug. 24, 2022 18:25:23)

Maximouse
Scratcher
1000+ posts

New scratch console commands?

CST1229 wrote:

Basically no user interaction endpoints are shown there (aka anything that isn't a GET).
towerofnix's documentation doesn't contain many endpoints other than GET either.

Last edited by Maximouse (Aug. 24, 2022 19:02:03)

ZZC12345
Scratcher
500+ posts

New scratch console commands?

CST1229 wrote:

Maximouse wrote:

(#27)

ZZC12345 wrote:

Dyno_Bot wrote:

tell me a list of user codes for scratch API (i mean commands)
Like endpoints? If so, here.
The list in the wiki is more up to date.
Basically no user interaction endpoints are shown there (aka anything that isn't a GET).
With the things you have access to per your account, you can PUT to using the JSON keys from the response (projects and studios).
Dyno_Bot
Scratcher
500+ posts

New scratch console commands?

ZZC12345 wrote:

CST1229 wrote:

Maximouse wrote:

(#27)

ZZC12345 wrote:

Dyno_Bot wrote:

tell me a list of user codes for scratch API (i mean commands)
Like endpoints? If so, here.
The list in the wiki is more up to date.
Basically no user interaction endpoints are shown there (aka anything that isn't a GET).
With the things you have access to per your account, you can PUT to using the JSON keys from the response (projects and studios).

how do you add commands?
pball79___64
Scratcher
100+ posts

New scratch console commands?

Last edited by pball79___64 (Aug. 24, 2022 22:22:40)

malyvb
Scratcher
17 posts

New scratch console commands?

GeekTech wrote:

Hello! I'm not sure if this is what your looking for but the following code returns the amount of messages a user currently has.
fetch("https://api.scratch.mit.edu/users/griffpatch/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});

You can also leave a studio easily by using this following code. There are tons more I know if you are somewhat interested
$.ajax({type: “PUT”,url: "https://scratch.mit.edu/site-api/users/curators-in/26612089/remove/?usernames=GeekTech"}); $( document ).ajaxComplete(function() { location.reload(); }); 
just modified the code so it makes it a lil bit easier to search for specific users
var user = prompt(“who?”);fetch("https://api.scratch.mit.edu/users/“ + user + ”/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});
-BlockCrafter-
Scratcher
14 posts

New scratch console commands?

good one
scratcher2286
Scratcher
79 posts

New scratch console commands?

Gamerboi276 wrote:

We all know the console command in inspect element where you can follow yourself, but that is the only command that I could find. Do any of you know other ones?
$.ajax({type: "PUT", url: "https://scratch.mit.edu/site-api/users/followers/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username + "/add/",data: {usernames: Scratch.INIT_DATA.LOGGED_IN_USER.model.username}})

Gamerboi276 wrote:

We all know the console command in inspect element where you can follow yourself, but that is the only command that I could find. Do any of you know other ones?
$.ajax({type: "PUT", url: "https://scratch.mit.edu/site-api/users/followers/" + Scratch.INIT_DATA.LOGGED_IN_USER.model.username + "/add/",data: {usernames: Scratch.INIT_DATA.LOGGED_IN_USER.model.username}})
I know one.
Use Scratchclient:
s = ScratchSession(“your-username”, “your-password”)
s.get_user(“your-username”).follow()
mybearworld
Scratcher
1000+ posts

New scratch console commands?

scratcher2286 wrote:

I know one.
Use Scratchclient:
s = ScratchSession(“your-username”, “your-password”)
s.get_user(“your-username”).follow()
That is Python, though, not for the console - it also uses a module specifically made for this.

Powered by DjangoBB