Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » scratchattach - A Scratch API wrapper (Python)
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
Hey, does anyone know how you can get image data, like profile pictures, into numerical data so scratchattach can send it? Can't find someone's source code for pfp lookup projects so I have no idea how that works.You should use the openCV library or PIL+numpy.
- ScratchTheCoder12345
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
I've done it before, check out my project https://scratch.mit.edu/projects/877729608/ I could supply the backend code for it, I used Pillow to get the RGBA values of the PFP and send them back.Hey, does anyone know how you can get image data, like profile pictures, into numerical data so scratchattach can send it? Can't find someone's source code for pfp lookup projects so I have no idea how that works.You should use the openCV library or PIL+numpy.
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
- ScratchTheCoder12345
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
No, thats allsorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
resolved
Last edited by CodingAnomaly (Aug. 4, 2023 15:55:28)
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
never mind, i've found the issue! sorry!
- ScratchTheCoder12345
-
Scratcher
500+ posts
scratchattach - A Scratch API wrapper (Python)
Share your Scratch project so we can see if you have any issues there.Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
Here it is:
import os
my_secret = os.environ
import scratchattach as scratch3
session = scratch3.Session(my_secret, username=“CodingAnomaly”)
conn = session.connect_cloud(“879988737”) #replace with your project id
client = scratch3.CloudRequests(conn)
@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project
@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is running”)
client.run()
Last edited by ScratchTheCoder12345 (Aug. 4, 2023 15:49:50)
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
deleted
Last edited by programORdie (Aug. 4, 2023 15:50:48)
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
i think the problem is not cloud cloud varsShare your Scratch project so we can see if you have any issues there.Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
Here it is:
import os
my_secret = os.environ
import scratchattach as scratch3
session = scratch3.Session(my_secret, username=“CodingAnomaly”)
conn = session.connect_cloud(“879988737”) #replace with your project id
client = scratch3.CloudRequests(conn)
@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project
@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is running”)
client.run()
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
Share your Scratch project so we can see if you have any issues there.Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
Here it is:
import os
my_secret = os.environ
import scratchattach as scratch3
session = scratch3.Session(my_secret, username=“CodingAnomaly”)
conn = session.connect_cloud(“879988737”) #replace with your project id
client = scratch3.CloudRequests(conn)
@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project
@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is running”)
client.run()
sorry! i fixed it! sorry for wasting your time!
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
i think the problem is not cloud cloud varsShare your Scratch project so we can see if you have any issues there.Hey, could you send your Python code?sorry lol, i really am quite new xD which ones should be cloud vars? i've converted all the ones that have clouds in the name, are there any others to convert?are cloud requests not working for anyone else? i am quite new to Scratchattach, so, i may be doing something wrong. but on replit it does say : Request Handler is Running. However, it does't seem to receive it from the scratch project. ¯\_(ツ)_/¯Did you converted the variables back to cloud vars?
Here it is:
import os
my_secret = os.environ
import scratchattach as scratch3
session = scratch3.Session(my_secret, username=“CodingAnomaly”)
conn = session.connect_cloud(“879988737”) #replace with your project id
client = scratch3.CloudRequests(conn)
@client.request
def ping(): #called when client receives request
print(“Ping request received”)
return “pong” #sends back ‘pong’ to the Scratch project
@client.request
def message_count(argument1):
print(f“Message count requested for user {argument1}”)
user = scratch3.get_user(argument1)
return user.message_count()
@client.event
def on_ready():
print(“Request handler is running”)
client.run()
^^^ see above
- programORdie
-
Scratcher
28 posts
scratchattach - A Scratch API wrapper (Python)
sorry! i fixed it! sorry for wasting your time!np!
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
deleted.
Last edited by CodingAnomaly (Aug. 4, 2023 17:49:01)
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
is there any way to still use replit with scratchattach?
- infintyrussia
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
is there any way to still use replit with scratchattach?Just use the session log in instead of the normal login.
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
when i do that, it still blocks cloud requests?is there any way to still use replit with scratchattach?Just use the session log in instead of the normal login.
- infintyrussia
-
Scratcher
100+ posts
scratchattach - A Scratch API wrapper (Python)
When you use session login you may use cloud vars but other features such as loving a project and posting comments cannot be completed.when i do that, it still blocks cloud requests?is there any way to still use replit with scratchattach?Just use the session log in instead of the normal login.
- CodingAnomaly
-
Scratcher
59 posts
scratchattach - A Scratch API wrapper (Python)
so there's no way to do certain things now on Replit, basically?When you use session login you may use cloud vars but other features such as loving a project and posting comments cannot be completed.when i do that, it still blocks cloud requests?is there any way to still use replit with scratchattach?Just use the session log in instead of the normal login.