Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Meowclient - connect to Scratch with NodeJS
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
meowclient
A library for using the Scratch API and cloud variables!
Source Code: https://github.com/webdev03/meowclient
NPM Package: https://www.npmjs.com/package/meowclient
Documentation: https://webdev03.github.io/meowclient
I may not add any social actions to the library because social actions could break the Terms of Use.
Thanks
Thanks to Scratchclient and Raihan142857 (CubeyTheCube) for the code to log in!
More information is available at the links above.
A library for using the Scratch API and cloud variables!
Source Code: https://github.com/webdev03/meowclient
NPM Package: https://www.npmjs.com/package/meowclient
Documentation: https://webdev03.github.io/meowclient
I may not add any social actions to the library because social actions could break the Terms of Use.
Thanks
Thanks to Scratchclient and Raihan142857 (CubeyTheCube) for the code to log in!
More information is available at the links above.
Last edited by god286 (March 17, 2023 09:07:12)
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
I have a question:
I've passed “this” from ScratchSession to my Profile class to get auth, but is there a more TypeScript-ish way to do that?
I've passed “this” from ScratchSession to my Profile class to get auth, but is there a more TypeScript-ish way to do that?
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
ok! just wondering what made you super excited? YESSS
- MagicCrayon9342
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
It can't get any easier than scratchclient lmao
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
There's a difference between Python and Javascript It can't get any easier than scratchclient lmao



- MagicCrayon9342
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
(#6)One's purely for websites one is purely for software…There's a difference between Python and Javascript It can't get any easier than scratchclient lmao![]()
![]()
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
I am now going to politely ask you to stop arguing over what JS and Python is for. If you're going to keep on doing this I'll politely ask you to stop posting on my forum threads if you make more useless arguments.(#6)One's purely for websites one is purely for software…There's a difference between Python and Javascript It can't get any easier than scratchclient lmao![]()
![]()
- Chiroyce
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
Sure it can't - but isn't this great for people who want to use TypeScript? It can't get any easier than scratchclient lmao
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
you dont even need to use typescript its optional, just type definitions = awesome for those who use it, btw I had to use typescript for esm and cjs supportSure it can't - but isn't this great for people who want to use TypeScript? It can't get any easier than scratchclient lmao
Last edited by god286 (Jan. 23, 2022 04:34:07)
- Chiroyce
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
Sorry I had to do this One's purely for websites one is purely for software…
- HTTP(S) servers
- Database integration
- macOS, Linux and Windows Apps
- Frontend Frameworks
- Vanilla JS
- Native iOS and Android Apps
“One's purely for websites” - I recommend that you take some time to think about this.
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
add in (I think) IOT uses, scripting with zx by Google, and more.Sorry I had to do this One's purely for websites one is purely for software…
- HTTP(S) servers
- Database integration
- macOS, Linux and Windows Apps
- Frontend Frameworks
- Vanilla JS
- Native iOS and Android Apps
“One's purely for websites” - I recommend that you take some time to think about this.
[/offtopic]
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
I'd also like to add that the only time you have to run .init is when creating the session. After that, you literally don't have to .init() on any profile, as it will automatically fetch the data if you haven't already 

- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
Definition files are fun, especially when they're automated for you 
I was trying to get JSDoc working earlier. I guess I'll just use Jekyll then since it doesn't work.

declare class Profile { user: string; status: string; private scratchUserHTML; auth: any; constructor(username: string, session: any); /** * Gets the status of the user * Can either be Scratcher, New Scratcher, or Scratch Team. * @returns {string} The status of the user. */ getStatus(): Promise<any>; /** * Deletes a comment * @param id The comment ID, for example 12345, *not* comment-12345 * @returns {number} The status code of the request. */ deleteComment(id: { toString: () => string; }): Promise<number>; private getUserHTML; /** * * @param page The page to look at. * @returns {Array} An array of comments. There is id, username, content, and apiID keys. * apiID is used to input into deleteComment */ getComments(page?: number): Promise<any[]>; } /** * Logs into Scratch */ declare class ScratchSession { username: string; csrfToken: string; token: string; cookieSet: string; /** * Sets up the ScratchSession to use authenticated functions * @param user The username of the user you want to log in to * @param pass The password of the user you want to log in to */ init(user: string, pass: string): Promise<void>; getProfile(username: string): Profile; } export { ScratchSession as default };
Last edited by god286 (Jan. 23, 2022 08:54:03)
- nampinanathali
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
Definition files are fun, especially when they're automated for youI was trying to get JSDoc working earlier. I guess I'll just use Jekyll then since it doesn't work.declare class Profile { user: string; status: string; private scratchUserHTML; auth: any; constructor(username: string, session: any); /** * Gets the status of the user * Can either be Scratcher, New Scratcher, or Scratch Team. * @returns {string} The status of the user. */ getStatus(): Promise<any>; /** * Deletes a comment * @param id The comment ID, for example 12345, *not* comment-12345 * @returns {number} The status code of the request. */ deleteComment(id: { toString: () => string; }): Promise<number>; private getUserHTML; /** * * @param page The page to look at. * @returns {Array} An array of comments. There is id, username, content, and apiID keys. * apiID is used to input into deleteComment */ getComments(page?: number): Promise<any[]>; } /** * Logs into Scratch */ declare class ScratchSession { username: string; csrfToken: string; token: string; cookieSet: string; /** * Sets up the ScratchSession to use authenticated functions * @param user The username of the user you want to log in to * @param pass The password of the user you want to log in to */ init(user: string, pass: string): Promise<void>; getProfile(username: string): Profile; } export { ScratchSession as default };
cool!
- Verixion
-
100+ posts
Meowclient - connect to Scratch with NodeJS
Meow.ts (Meow.js TS) was on my high priority list haha. Nvm now I guess
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
You can do that if you want! Meow.ts (Meow.js TS) was on my high priority list haha. Nvm now I guess
Last edited by god286 (Jan. 23, 2022 19:15:41)
- god286
-
1000+ posts
Meowclient - connect to Scratch with NodeJS
Now open source in beta
https://github.com/webdev03/meowclient/
https://github.com/webdev03/meowclient/
- Discussion Forums
- » Advanced Topics
-
» Meowclient - connect to Scratch with NodeJS