Discuss Scratch

god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

bump

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.


hi im silver

























i eat orphan babies
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)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.


This is Maximouse's signature. Learn more about signatures.
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)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.


This is Maximouse's signature. Learn more about signatures.
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?

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.)

const juniper = programmer && musician;
// my pronouns are she/her
// i am trans and bi :P
// you can call me june or juni for short but i prefer juniper
python version:
juniper = programmer and musician
# my pronouns are she/her
# i am trans and bi :P
# you can call me june or juni for short but i prefer juniper
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();

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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.

Mod's Protogen Maker v2 released. I will update it when I will update it
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)


Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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)

const juniper = programmer && musician;
// my pronouns are she/her
// i am trans and bi :P
// you can call me june or juni for short but i prefer juniper
python version:
juniper = programmer and musician
# my pronouns are she/her
# i am trans and bi :P
# you can call me june or juni for short but i prefer juniper
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!

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
Redstone1080
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

buyt

const juniper = programmer && musician;
// my pronouns are she/her
// i am trans and bi :P
// you can call me june or juni for short but i prefer juniper
python version:
juniper = programmer and musician
# my pronouns are she/her
# i am trans and bi :P
# you can call me june or juni for short but i prefer juniper
god286
Scratcher
1000+ posts

Meowclient - connect to Scratch with NodeJS

Redstone1080 wrote:

buyt
What

Here are some of my followers!

I joined: 5 years, 9 months, 24 days ago (31/03/2018)
I have: 479 followers
In total, I have attained: 1,403 loves, 1,145 favourites, and 33,731 views.
Fun Fact: If my account continued to gain followers at a similar rate to right now, in 14,210 years I would reach the number of followers griffpatch has today! Try to imagine how many followers he would have then!
Thank you everyone!
Script created by god286.
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”

const juniper = programmer && musician;
// my pronouns are she/her
// i am trans and bi :P
// you can call me june or juni for short but i prefer juniper
python version:
juniper = programmer and musician
# my pronouns are she/her
# i am trans and bi :P
# you can call me june or juni for short but i prefer juniper

Powered by DjangoBB