PolyEdge / scratchapi

[CURRENTLY UNMAINTAINED] Scratch API Interface
40 stars 15 forks source link

Update for newcloud #18

Open herronjo opened 7 years ago

herronjo commented 7 years ago

Scratch recently released a feature called “newcloud”, and for a while, it was an optional thing that you’d put at the end of the url to use the new cloud system (?newcloud). Now, with the update to the messages system, it seems they have shut down the old cloud server and replaced it with newcloud as the default. This system uses websockets (and I think TCP), and as far as I know, has no easy way to get cloud variables through an API like you used to.

skistaddy commented 7 years ago

Is there any forum discussion for this?

herronjo commented 7 years ago

https://scratch.mit.edu/discuss/topic/274278/ With the new messages update, this is now the default, and I don't think you can get the old cloud back. As far as I know, there is no API as of yet, it uses websockets, and the /varserver/ID doesn't work anymore to get data.

skistaddy commented 7 years ago

It looks like trumank has updated his API to use websockets.

herronjo commented 7 years ago

Yeah, I saw, so I switched back. I'm just waiting on this one to update.

PolyEdge commented 7 years ago

Im dead sorry lmao

prail commented 7 years ago

@PolyEdge It's okay...

herronjo commented 7 years ago

Oh, it’s okay. Hopefully somebody will revive this and fork it some time.

PolyEdge commented 5 years ago

It's been a while, but I have decided to bring the API back up to date. I currently have a (pretty stable?) websocket interface (fa87e7d). Currently many things don't work because I'm modifying the actual structure of the library, but out of all things, CloudSessions are working (but you need the websockets module). I did my best to look for a non async websockets implementation but could not find any that supported adding custom headers. At this point I am pretty sure you can only use the module on python 3.6 and maybe even 3.5 but not 3.7 or 3.5 and below because of the conflict with asyncio.async and the keyword. There is a synchronous wrapper for AIOCloudSession included. I'm planning on implementing the REST API later on. Just wanted to let everyone know in case you're still into scratch or whatever, but it's fine if you're not.

PolyEdge commented 5 years ago

cc @BookOwl @TheLogFather