-
Notifications
You must be signed in to change notification settings - Fork 10
ScratchSession
The username of the logged in user.
Example:
session = ScratchSession("ceebee", "--uwu--")
print(session.username)
# ceebee
The Scratch session ID of the logged in user's session.
The X-Token of the logged in user.
The CSRF token of the logged in user's session.
The User object of the logged in user.
Example:
session = ScratchSession("ceebee", "--uwu--")
print(session.user.id)
# 2755634
Gets the User object of the specified username.
Example:
print(session.get_user("griffpatch").scratchteam)
# False
Gets the Project object for the specified ID.
Example:
print(session.get_project(60917032).title)
# Appel v1.4
Gets the Studio object for the specified ID.
Example:
print(session.get_studio(26135902).owner)
# Za-Chary
Gets Scratch's news as an array of News objects.
Example:
print(session.get_news()[0].title)
# Wiki Wednesday!
Gets the messages of the logged in user as an array of Message objects. If the all
parameter is specified as True
, all the messages are fetched. Otherwise, they are fetched with a limit of limit
messages and and offset of offset
. If a filter is provided, the messages are filtered with it.
Example:
print(session.get_messages(all=True)[0].actor)
# griffpatch
print(session.get_messages(limit=40, offset=10, filter="comments")[0].comment_fragment)
# thank you my friend
Creates a cloud connection for the specified project ID. Returns a CloudConnection object.
Example:
connection = session.create_cloud_connection(104)
print(connection.get_cloud_variable('foo'))
Explores Scratch projects with the specified mode
and query
. Returns an array of Project objects.
Example:
print(session.explore_projects()[0].title)
# Epic 7D platformer 2021
Explores Scratch studios with the specified mode
and query
. Returns an array of Studio objects.
Searches Scratch projects with the specified mode
and query
. Returns an array of Project objects.
Searches Scratch studios with the specified mode
and query
. Returns an array of Studio objects.