Discuss Scratch

Amolorty
Scratcher
15 posts

Is there a way to communicate with the scratch API, within a scratch project?

Hi. I would like to display how many messages I have in a project, and I would need this:
https://api.scratch.mit.edu/users/Amolorty/messages/count
to display on a project. anyway to do that?

TIA, Amolorty
EggDOG_MyNAME--Jeff
Scratcher
100+ posts

Is there a way to communicate with the scratch API, within a scratch project?

I don't think it's possible, atleast not with regular scratch blocks.
MrCloudGame
Scratcher
100+ posts

Is there a way to communicate with the scratch API, within a scratch project?

Amolorty wrote:

Hi. I would like to display how many messages I have in a project, and I would need this:
https://api.scratch.mit.edu/users/Amolorty/messages/count
to display on a project. anyway to do that?

TIA, Amolorty


it is possible with @timmccool scratchattach
IGABMS
Scratcher
100+ posts

Is there a way to communicate with the scratch API, within a scratch project?

Amolorty wrote:

Hi. I would like to display how many messages I have in a project, and I would need this:
https://api.scratch.mit.edu/users/Amolorty/messages/count
to display on a project. anyway to do that?

TIA, Amolorty
There are plenty of ways to do what you are suggesting.

https://pypi.org/project/scratchcloud/ is a Python package that will let you communicate with a Scratch project.

So here's how it would work:
  1. Your server fetches your message count, and saves them
    Your server connects to Scratch via scratchcloud
    Your server sends the messages via cloud variables
    Your Scratch project decodes what it receives.

Let me know if you have any questions by messaging me on my profile.



Powered by DjangoBB