Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » How do you set cloud variables in python using websockets?
- JackK211424
- Scratcher
500+ posts
How do you set cloud variables in python using websockets?
Ok.
So far I know this much.
Connect to
wss://clouddata.scratch.mit.edu
with the headers
cookie: scratchsessionsid={enter session id here};
origin: 'https://scratch.mit.edu'
Then, On connection, you must send a handshake.
This is as much as I have understood to connect to the server.
Im going to update it later (If I can understand the rest)
So far I know this much.
Connect to
wss://clouddata.scratch.mit.edu
with the headers
cookie: scratchsessionsid={enter session id here};
origin: 'https://scratch.mit.edu'
Then, On connection, you must send a handshake.
This is as much as I have understood to connect to the server.
Im going to update it later (If I can understand the rest)
Last edited by JackK211424 (Feb. 28, 2021 15:32:27)
- ninjaMAR
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Where would I send those headers Ok.
So far I know this much.
Connect to
wss://clouddata.scratch.mit.edu
with the headers
cookie: scratchsessionsid={enter session id here};
origin: 'https://scratch.mit.edu'
Then, On connection, you must send a handshake.
This is as much as I have understood to connect to the server.
Im going to update it later (If I can understand the rest)
- 9gr
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Javascript in python hmmmmmWhere would I send those headers Ok.
So far I know this much.
Connect to
wss://clouddata.scratch.mit.edu
with the headers
cookie: scratchsessionsid={enter session id here};
origin: 'https://scratch.mit.edu'
Then, On connection, you must send a handshake.
This is as much as I have understood to connect to the server.
Im going to update it later (If I can understand the rest)
- Chiroyce
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
uhh which one? I used you and @pufferfish_test code as an example
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- ninjaMAR
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
https://scratch.mit.edu/discuss/topic/483540/?page=2#post-4938959uhh which one? I used you and @pufferfish_test code as an example
- Chiroyce
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Ah okhttps://scratch.mit.edu/discuss/topic/483540/?page=2#post-4938959uhh which one? I used you and @pufferfish_test code as an example
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Sheep_maker
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Presumably you'd send your credentials in a Cookie header; according to the documentation, you can pass in a dict to the `extra_headers` parameter:
Headers from here
headers = { 'Cookie': f'scratchsessionid={your_session_id}', 'Origin': 'https://scratch.mit.edu' } async with websockets.connect('wss://clouddata.scratch.mit.edu/', extra_headers=headers) as websocket:
- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
- ninjaMAR
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
the documentation, you can pass in a dict to the `extra_headers` parameter:I did it but it doesn't work. Presumably you'd send your credentials in a Cookie header; according to This is my codeHeaders from hereheaders = { 'Cookie': f'scratchsessionid={your_session_id}', 'Origin': 'https://scratch.mit.edu' } async with websockets.connect('wss://clouddata.scratch.mit.edu/', extra_headers=headers) as websocket:
- SansStudios
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Bump.
☁️ scratchcloud ☁️
Click above to check it out! I've worked on it for over a year!
Just like sudden sadness comes hangin' on the breeze
- TheCloudDev
- Scratcher
100+ posts
How do you set cloud variables in python using websockets?
four duotrigintillion eleven untrigintillion nine hundred ninety-one trigintillion nine hundred fourteen novemvigintillion five hundred forty-seven octovigintillion six hundred thirty septenvigintillion four hundred eighty sexvigintillion sixty-five quinvigintillion fifty-three quattuorvigintillion three hundred eighty-seven trevigintillion seven hundred two duovigintillion four hundred forty-three unvigintillion eight hundred twelve vigintillion six hundred ninety novemdecillion four hundred two octodecillion four hundred eighty-seven septendecillion seven hundred forty-one sexdecillion eight hundred twelve quindecillion two hundred twenty-five quattuordecillion nine hundred fifty-five tredecillion seven hundred thirty-one duodecillion six hundred twenty-two undecillion six hundred fifty-five decillion four hundred fifty-five nonillion seven hundred twenty-three octillion two hundred fifty-eight septillion eight hundred fifty-seven sextillion two hundred forty-eight quintillion five hundred forty-two quadrillion one hundred sixty-one trillion two hundred twenty-two billion two hundred fifty-four million nine hundred eighty-five thousand two hundred sixteen
Possible combinations for SHA-256 hashing. Should be enough? xD (did some maths and this was the answer)
Possible combinations for SHA-256 hashing. Should be enough? xD (did some maths and this was the answer)
Hi! I'm TheCloudDev
- Chiroyce
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
bruh it's used by Facebook Google Apple and Microsoft, how is that not enough?!? Possible combinations for SHA-256 hashing. Should be enough? xD (did some maths and this was the answer)
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Chiroyce
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
bump
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Sheep_maker
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
“doesn't work” is a bit vague; how do you know it doesn't work?the documentation, you can pass in a dict to the `extra_headers` parameter:I did it but it doesn't work. Presumably you'd send your credentials in a Cookie header; according to This is my codeHeaders from hereheaders = { 'Cookie': f'scratchsessionid={your_session_id}', 'Origin': 'https://scratch.mit.edu' } async with websockets.connect('wss://clouddata.scratch.mit.edu/', extra_headers=headers) as websocket:
- Sheep_maker This is a kumquat-free signature. :P
This is my signature. It appears below all my posts. Discuss it on my profile, not the forums. Here's how to make your own.
.postsignature { overflow: auto; } .scratchblocks { overflow-x: auto; overflow-y: hidden; }
- ninjaMAR
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
It doesn't change the cloud variables“doesn't work” is a bit vague; how do you know it doesn't work?the documentation, you can pass in a dict to the `extra_headers` parameter:I did it but it doesn't work. Presumably you'd send your credentials in a Cookie header; according to This is my codeHeaders from hereheaders = { 'Cookie': f'scratchsessionid={your_session_id}', 'Origin': 'https://scratch.mit.edu' } async with websockets.connect('wss://clouddata.scratch.mit.edu/', extra_headers=headers) as websocket:
- Maximouse
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Maybe you forgot ssl=True? I don't think websockets check the URL to determine if it should use a secure connection or not. It doesn't change the cloud variables
- Chiroyce
- Scratcher
1000+ posts
How do you set cloud variables in python using websockets?
Where should I add that? My code Maybe you forgot ssl=True? I don't think websockets check the URL to determine if it should use a secure connection or not.
import asyncio, websockets, os headers = { 'Cookie': f'scratchsessionid={os.getenv("sessionid")}', 'Origin': 'https://scratch.mit.edu' } async def send(): data = ['{"name": "handshake", "user": "Chiroyce", "project_id": 501336792}','{"method":"set","user":"Chiroyce","project_id":"501336792","name":"☁ Cloud","value":123456789}'] async with websockets.connect('wss://clouddata.scratch.mit.edu/',extra_headers=headers) as websocket: for i in data: await websocket.send(i) #response = await websocket.recv() #print(response) asyncio.get_event_loop().run_until_complete(send())
April Fools' topics:
— New Buildings in Scratch's headquarters
— Give every Scratcher an M1 MacBook Air
— Scratch should let users edit other Scratchers' projects
— Make a statue for Jeffalo
— Scratch Tech Tips™
— Make a Chiroyce statue emoji
<img src=“x” onerror=“alert('XSS vulnerability discovered')”>
this is a test sentence
- Danger_script
- Scratcher
20 posts
How do you set cloud variables in python using websockets?
I really do not know when I know how but I can see how. How do you set cloud variables in python using websockets?
My codeimport asyncio import websockets import os headers = { 'Cookie': f'scratchsessionid={os.getenv("sessionid")}', 'Origin': 'https://scratch.mit.edu' } async def send(): data = ['{"name": "handshake", "user": "ninjaMAR", "project_id": 438906671}','{"method":"set","user":"ninjaMAR","project_id":"438906671","name":"☁ Test3","value":123456789}'] async with websockets.connect('wss://clouddata.scratch.mit.edu/',extra_headers=headers) as websocket: for i in data: await websocket.send(i) response = await websocket.recv() print(response) asyncio.get_event_loop().run_until_complete(send())
Hi, I am a undrated scratcher can you plz follow me? I like to code in python and learning HTML, CSS, and javascript. I am a scout so do not be mean to me or anyone.
Plz follow me.
My dad is better than me at coding. When I am learning coding skills from him to get better. my dad knows how to code in java and other hard coding languages that I do not know.
- Discussion Forums
- » Advanced Topics
- » How do you set cloud variables in python using websockets?