Discuss Scratch

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

bump
silvxrcat
Scratcher
500+ posts

Meowclient - connect to Scratch with NodeJS

Is there a way to get comments using this? I wouldn't consider this a form of social interaction.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

I'm working on better types for mutes in the Session JSON, but I have a question:
In Session JSON, permissions.mute_status.currentMessageType can be either string or null right?

silvxrcat wrote:

Is there a way to get comments using this? I wouldn't consider this a form of social interaction.
Profile comments:
import { ScratchSession } from "meowclient";
const user = "123";
const pass = "example";
const session = new ScratchSession();
await session.init(user, pass);
const myProfile = session.getProfile(user);
const page = 1;
const comments = await myProfile.getComments(page);
each comment has “id”, “username”, “content”, and “apiID” (apiID is used to put into deleteComment, console.log if you don't understand the difference)

Last edited by god286 (Aug. 1, 2022 06:50:40)

Maximouse
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

In Session JSON, permissions.mute_status.currentMessageType can be either string or null right?
It's a string. I'm not sure if it can be null – if the user is not muted it's simply omitted.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Maximouse wrote:

god286 wrote:

In Session JSON, permissions.mute_status.currentMessageType can be either string or null right?
It's a string. I'm not sure if it can be null – if the user is not muted it's simply omitted.
I got muted so I checked the session json:
mute_status: {
offenses: [Array],
showWarning: false,
muteExpiresAt: (a unix time),
currentMessageType: null
}

Last edited by god286 (Aug. 1, 2022 07:47:00)

Maximouse
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

Maximouse wrote:

god286 wrote:

In Session JSON, permissions.mute_status.currentMessageType can be either string or null right?
It's a string. I'm not sure if it can be null – if the user is not muted it's simply omitted.
I got muted so I checked the session json:
mute_status: {
offenses: [Array],
showWarning: false,
muteExpiresAt: (a unix time),
currentMessageType: null
}
Maybe null means a generic message.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

I got it to say ‘account’ so it is a string or null.
There's also a ‘everything_is_totally_normal’ should I add that to the types?
Redstone1080
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

You should add session token-based login, I don't feel safe putting my username & password into my code. (Yes I know about environment variables, but if someone has hacked into your computer and grabbed the source code, they've probably found the environment variable values too.)
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Redstone1080 wrote:

You should add session token-based login, I don't feel safe putting my username & password into my code. (Yes I know about environment variables, but if someone has hacked into your computer and grabbed the source code, they've probably found the environment variable values too.)
If they hack your computer then they have your token and your other passwords that are more important than scratch.. but ok..
Current workaround:
import { ScratchSession } from "meowclient";
const session = new ScratchSession();
session.username = "me";
session.token = "abc";
session.csrfToken = "abc";
session.cookieSet = "scratchcsrftoken=" + session.csrfToken + ";scratchlanguage=en;scratchsessionsid=" + session.token + ";";
const sessionFetch = await fetch("https://scratch.mit.edu/session", {
      method: "GET",
      headers: {
        Cookie: this.cookieSet,
        "User-Agent": "Mozilla/5.0",
        Referer: "https://scratch.mit.edu/",
        Host: "scratch.mit.edu",
        "Cache-Control": "max-age=0, no-cache",
        "X-Requested-With": "XMLHttpRequest",
        Pragma: "no-cache",
        Accept: "*/*",
        "Accept-Encoding": "gzip, deflate, br"
      }
    });
    session.sessionJSON = await sessionFetch.json();
TheGlassPenguin
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

sorry to bump up this old thread, but is it possible to just get the API data of something without needing to create an authenticated ScratchSession?
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

TheGlassPenguin wrote:

(#110)
sorry to bump up this old thread, but is it possible to just get the API data of something without needing to create an authenticated ScratchSession?
If you don't .init the scratchsession it should work
Also I was about to bump it up anyways when I release 3.0

Last edited by god286 (Nov. 15, 2022 03:24:23)

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

I have been working on meowclient v3, there is a PR open at https://github.com/webdev03/meowclient/pull/28 with all of the changes. It will be merged soon. Please check the code if you want to and if you find any bugs report them.
ajskateboarder
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Here's a list of Python Scratch libraries I found in about 10 minutes:
Thanks for making a neat TS client for once
DifferentDance8
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

ajskateboarder wrote:

Thanks for making a neat TS client for once
I'm technically working on a Java one, but since I am a master at procrastination, I haven't got much done.
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Ocular reaction
Should I merge v3? Will merge tomorrow after final check

ajskateboarder wrote:

(#113)
Here's a list of Python Scratch libraries I found in about 10 minutes:
Thanks for making a neat TS client for once
Thanks! I am glad to see that someone likes it! If you have any feature requests please tell me.

DifferentDance8 wrote:

(#114)

ajskateboarder wrote:

Thanks for making a neat TS client for once
I'm technically working on a Java one, but since I am a master at procrastination, I haven't got much done.
Cool!

Last edited by god286 (Dec. 1, 2022 08:47:49)

Redstone1080
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

DifferentDance8 wrote:

(#114)

ajskateboarder wrote:

Thanks for making a neat TS client for once
I'm technically working on a Java one, but since I am a master at procrastination, I haven't got much done.
I'm also sorta making one in Lua (requires LuaRocks for packages tho)
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

In 1 hour I am going to merge the PR. No more delays.
Thanks to @uwv for a lot of help in the coding!
Redstone1080
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

buyt
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Redstone1080 wrote:

buyt
What
Redstone1080
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

god286 wrote:

(#119)

Redstone1080 wrote:

buyt
What
It's a term I coined. It means “Bring Up Your Topic”

Powered by DjangoBB