Discuss Scratch
- MagicCrayon9342
-
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
-
1 post
New scratch console commands?
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
-
500+ posts
New scratch console commands?
tell me a list of user codes for scratch API (i mean commands)
- Maximouse
-
1000+ posts
New scratch console commands?
The list in the wiki is more up to date.Like endpoints? If so, tell me a list of user codes for scratch API (i mean commands)here.
- CST1229
-
1000+ posts
New scratch console commands?
(#27)Basically no user interaction endpoints are shown there (aka anything that isn't a GET).The list in the wiki is more up to date.Like endpoints? If so, tell me a list of user codes for scratch API (i mean commands)here.
Last edited by CST1229 (Aug. 24, 2022 18:25:23)
- Maximouse
-
1000+ posts
New scratch console commands?
towerofnix's documentation doesn't contain many endpoints other than GET either. Basically no user interaction endpoints are shown there (aka anything that isn't a GET).
Last edited by Maximouse (Aug. 24, 2022 19:02:03)
- ZZC12345
-
500+ posts
New scratch console commands?
With the things you have access to per your account, you can PUT to using the JSON keys from the response (projects and studios).(#27)Basically no user interaction endpoints are shown there (aka anything that isn't a GET).The list in the wiki is more up to date.Like endpoints? If so, tell me a list of user codes for scratch API (i mean commands)here.
- Dyno_Bot
-
500+ posts
New scratch console commands?
With the things you have access to per your account, you can PUT to using the JSON keys from the response (projects and studios).(#27)Basically no user interaction endpoints are shown there (aka anything that isn't a GET).The list in the wiki is more up to date.Like endpoints? If so, tell me a list of user codes for scratch API (i mean commands)here.
how do you add commands?
- pball79___64
-
100+ posts
New scratch console commands?
…
Last edited by pball79___64 (Aug. 24, 2022 22:22:40)
- malyvb
-
17 posts
New scratch console commands?
just modified the code so it makes it a lil bit easier to search for specific users 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(); });
var user = prompt(“who?”);fetch("https://api.scratch.mit.edu/users/“ + user + ”/messages/count")
.then(res => res.json())
.then(obj => {
alert(obj.count);
});
- scratcher2286
-
79 posts
New scratch console commands?
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. 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}})
Use Scratchclient:
s = ScratchSession(“your-username”, “your-password”)
s.get_user(“your-username”).follow()
- mybearworld
-
1000+ posts
New scratch console commands?
That is Python, though, not for the console - it also uses a module specifically made for this. I know one.
Use Scratchclient:
s = ScratchSession(“your-username”, “your-password”)
s.get_user(“your-username”).follow()