Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- ShadowMilo
- Scratcher
13 posts
scratchattach - A Scratch API wrapper (Python)
I think so, if it can, i'm defenetly goind to include it in a 2.0 of one of my games Just a quick question, but can ScratchAttach be used to make an account system for a game or no? Because considering that Python can store values sent through the cloud into a local variable, you can just have it be saved in the IDE and send the data when requested. Either that or I'm getting it completely wrong lol.
- -King-Jack-
- Scratcher
2 posts
scratchattach - A Scratch API wrapper (Python)
does it work for https://www.online-python.com/ ?
-Jack
gender: boy/him/he/male
age: 11
Coder, Gamer, Business Man
- EpicCoderGamer1000
- Scratcher
74 posts
scratchattach - A Scratch API wrapper (Python)
I believe it can be used for that Just a quick question, but can ScratchAttach be used to make an account system for a game or no? Because considering that Python can store values sent through the cloud into a local variable, you can just have it be saved in the IDE and send the data when requested. Either that or I'm getting it completely wrong lol.
epic coder gamer 1000
- EpicCoderGamer1000
- Scratcher
74 posts
scratchattach - A Scratch API wrapper (Python)
https://www.online-python.com/ ?no does it work for
epic coder gamer 1000
- nexoalex
- Scratcher
61 posts
scratchattach - A Scratch API wrapper (Python)
its to hard to use scratchattachPyCharm isn't free?Use pycharm and install it Scratch3.py isn't working for me.
- zeeplockd
- Scratcher
1 post
scratchattach - A Scratch API wrapper (Python)
I have ran into a problem I just can't seem to fix relating to getting the comments of a users profile. Whenever I try to do it (I am signed in so using the `connect_user()` method then the `user.comments()` method) it returns a 404 error. The scratch account is definitely valid. The error says “Repl not found.” Would appreciate some help!
Code:
```
import scratchattach as scratch3
import requests
session = scratch3.login(“zeep-bot”, “******”)
myuser = session.connect_user(“zeeplockd”)
myuser.follow()
comments = myuser.comments()
print(f“{comments}\n\n”)
for message in comments:
if ‘Content’ in message and ‘how are you’ in message:
print(f"===\nFound the text in the content of a message.\nID: {message}\nUser: {message}\n===")
has_zeepbot_reply = False
if ‘Replies’ in message:
for reply in message:
if ‘User’ in reply and reply == ‘zeep-bot’:
has_zeepbot_reply = True
print(“Found a reply from ‘zeep-bot’.”)
break # Exit the loop if a previous reply is found
if not has_zeepbot_reply:
# Get user ID using the Scratch API
print(message)
api_url = f"https://api.scratch.mit.edu/users/{message}“
response = requests.get(api_url)
print(response)
datares = response.json()
myuser.reply_comment(”Great thanks!", parent_id=message, commentee_id=datares)
break # Exit the loop after posting the reply
```
Error:
```
{'message': ‘Repl not found’, ‘name’: ‘NotFoundError’, ‘status’: 404}
```
Code:
```
import scratchattach as scratch3
import requests
session = scratch3.login(“zeep-bot”, “******”)
myuser = session.connect_user(“zeeplockd”)
myuser.follow()
comments = myuser.comments()
print(f“{comments}\n\n”)
for message in comments:
if ‘Content’ in message and ‘how are you’ in message:
print(f"===\nFound the text in the content of a message.\nID: {message}\nUser: {message}\n===")
has_zeepbot_reply = False
if ‘Replies’ in message:
for reply in message:
if ‘User’ in reply and reply == ‘zeep-bot’:
has_zeepbot_reply = True
print(“Found a reply from ‘zeep-bot’.”)
break # Exit the loop if a previous reply is found
if not has_zeepbot_reply:
# Get user ID using the Scratch API
print(message)
api_url = f"https://api.scratch.mit.edu/users/{message}“
response = requests.get(api_url)
print(response)
datares = response.json()
myuser.reply_comment(”Great thanks!", parent_id=message, commentee_id=datares)
break # Exit the loop after posting the reply
```
Error:
```
{'message': ‘Repl not found’, ‘name’: ‘NotFoundError’, ‘status’: 404}
```
Last edited by zeeplockd (March 10, 2024 07:25:29)
- TimMcCool
- Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
@zeeplockd update scratchattach
Developer of scratchattach, the most popular Python Scratch API wrapper
- haydenyapts
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
How do I install it. I can't install it in my Command Prompt.
Pls help @TimMcCool
Pls help @TimMcCool
Last edited by haydenyapts (March 10, 2024 22:32:14)
- blockgamer904
- Scratcher
2 posts
scratchattach - A Scratch API wrapper (Python)
Hello, I am having problems with “import scratchattach as scratch3” as it gives the error: “ModuleNotFoundError: No module named ‘scratchattach’”. I'm sure I installed it correctly, but I'm new to python. Did I do something wrong?
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
@cloud Blockgamer904 @cloud :: grey
- Sc-JCat
- Scratcher
2 posts
scratchattach - A Scratch API wrapper (Python)
i used pythonanywhere to host the code but it is blocked by scratch. i got a 403 error. is there any way to get around it?
- Jay_C47
- Scratcher
18 posts
scratchattach - A Scratch API wrapper (Python)
can I use scratch attach without python
Profile
Hi, call me Jay, I'm an 11-year-old boy and I like to do art. (I make banners)
(you should consider following me)
pfp by: @GummiToons
lazy sentences | Request a Banner | My Contest
- blockgamer904
- Scratcher
2 posts
scratchattach - A Scratch API wrapper (Python)
No, you cant. can I use scratch attach without python
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
@cloud Blockgamer904 @cloud :: grey
- Air_heads
- Scratcher
79 posts
scratchattach - A Scratch API wrapper (Python)
Hello, I am having problems with “import scratchattach as scratch3” as it gives the error: “ModuleNotFoundError: No module named ‘scratchattach’”. I'm sure I installed it correctly, but I'm new to python. Did I do something wrong?
Enter ‘pip install scratchattach’ in the terminal of your computer (or the one in your editor if your editor provides it).
- justablock
- Scratcher
16 posts
scratchattach - A Scratch API wrapper (Python)
proxy ig? i used pythonanywhere to host the code but it is blocked by scratch. i got a 403 error. is there any way to get around it?
- nexoalex
- Scratcher
61 posts
scratchattach - A Scratch API wrapper (Python)
pip i think How do I install it. I can't install it in my Command Prompt.
Pls help @TimMcCool
- nexoalex
- Scratcher
61 posts
scratchattach - A Scratch API wrapper (Python)
are you sure you installed it before running it and how did you install it Hello, I am having problems with “import scratchattach as scratch3” as it gives the error: “ModuleNotFoundError: No module named ‘scratchattach’”. I'm sure I installed it correctly, but I'm new to python. Did I do something wrong?
- nexoalex
- Scratcher
61 posts
scratchattach - A Scratch API wrapper (Python)
i know just install pip then put pip install pip if u havent then run pip install scratchattach then youve installed it Hello, I am having problems with “import scratchattach as scratch3” as it gives the error: “ModuleNotFoundError: No module named ‘scratchattach’”. I'm sure I installed it correctly, but I'm new to python. Did I do something wrong?
- Jay_C47
- Scratcher
18 posts
scratchattach - A Scratch API wrapper (Python)
NOOOOOOOOOOO!!!!No, you cant. can I use scratch attach without python
Profile
Hi, call me Jay, I'm an 11-year-old boy and I like to do art. (I make banners)
(you should consider following me)
pfp by: @GummiToons
lazy sentences | Request a Banner | My Contest
- Ryan_shamu_YT
- Scratcher
20 posts
scratchattach - A Scratch API wrapper (Python)
You can look at my project (pfp loader) and see how it works how to make pfp renderhttps://scratch.mit.edu/projects/983994522/ python code: https://github.com/Ryan-shamu-YT/pfploader I hope it can give you an understanding, but the code is not the best.
Last edited by Ryan_shamu_YT (March 19, 2024 19:51:54)
I am still alive