Discuss Scratch

hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

Do cloud variables really work for embedded projetcs?

I haven't seen it work yet.

In the wiki it is said:

“Embedded projects can still use the cloud data functionalities only if the viewer of the embedded project is logged in to Scratch on his or her web browser. If one is not logged in to Scratch while viewing an embedded project, the cloud data will not save to the Scratch servers.”

(https://en.scratch-wiki.info/wiki/How_to_Embed_a_Project#Cloud_Data)

But this might be incorrect.

Do anyone have an example of a project that communicates properly with the cloud when embedded in another website?

Last edited by hegenb (July 19, 2018 17:58:19)

ScratchDiogoh
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

I agree with the scratch wiki, because only scratchers can use cloud data
I think the cloud data does not act differently.
in projects on other sites

Last edited by ScratchDiogoh (July 20, 2018 16:04:56)


+1700 Bad Posts
DeleteThisAcount
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

ScratchDiogoh wrote:

I agree with the scratch wiki, because only scratchers can use cloud data7
I think the cloud data does not act differently.
in projects on other sites
(removed by moderator - please keep it polite)
-

On your computer scratch stores a cookie that contains if you are signed in or signed out, if you are a scratcher, a scratch team member of of you are a new scratcher.

What should happen is the embedded viewer reads that cookie and allowes for cloud data to work properly.

But because of the inconsistency of cloud data, there is no way to be sure that the embedded player will send and receive cloud data from the scratch servers 100% of the time.

If you would like a project that tests cloud data I would recommend making a project with a button that changes a cloud data variable up by 1. Open up this project in one tab, make sure you are signed in to a scratcher status account. Open up a new tab of a website with the scratch project embedded. If you don't have one, you can make a quick html webpage with just the embed code.

Last edited by Paddle2See (July 20, 2018 15:05:11)




Raytracing
Scratcher
86 posts

Cloud Variables in embedded projetcs

DeleteThisAcount wrote:

ScratchDiogoh wrote:

I agree with the scratch wiki, because only scratchers can use cloud data7
I think the cloud data does not act differently.
in projects on other sites
(removed by moderator - please keep it polite)

-

On your computer scratch stores a cookie that contains if you are signed in or signed out, if you are a scratcher, a scratch team member of of you are a new scratcher.

What should happen is the embedded viewer reads that cookie and allowes for cloud data to work properly.

But because of the inconsistency of cloud data, there is no way to be sure that the embedded player will send and receive cloud data from the scratch servers 100% of the time.

If you would like a project that tests cloud data I would recommend making a project with a button that changes a cloud data variable up by 1. Open up this project in one tab, make sure you are signed in to a scratcher status account. Open up a new tab of a website with the scratch project embedded. If you don't have one, you can make a quick html webpage with just the embed code.

Scratch actually get info from /session/ which access is denied if the origin is not from scratch with specific headers, It is the website the page that sends that request not the project. So no you would not be able to. Also Scratch is linked to Websockets so its way harder. Only a lucky few know how to connect to cloud.

Last edited by Paddle2See (July 20, 2018 15:05:42)


insert something here




DeleteThisAcount
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

Raytracing wrote:

DeleteThisAcount wrote:

ScratchDiogoh wrote:

I agree with the scratch wiki, because only scratchers can use cloud data7
I think the cloud data does not act differently.
in projects on other sites
(removed by moderator - please keep it polite)

-

On your computer scratch stores a cookie that contains if you are signed in or signed out, if you are a scratcher, a scratch team member of of you are a new scratcher.

What should happen is the embedded viewer reads that cookie and allowes for cloud data to work properly.

But because of the inconsistency of cloud data, there is no way to be sure that the embedded player will send and receive cloud data from the scratch servers 100% of the time.

If you would like a project that tests cloud data I would recommend making a project with a button that changes a cloud data variable up by 1. Open up this project in one tab, make sure you are signed in to a scratcher status account. Open up a new tab of a website with the scratch project embedded. If you don't have one, you can make a quick html webpage with just the embed code.

Scratch actually get info from /session/ which access is denied if the origin is not from scratch with specific headers, It is the website the page that sends that request not the project. So no you would not be able to. Also Scratch is linked to Websockets so its way harder. Only a lucky few know how to connect to cloud.

+1 forgot about the /session/ part

Last edited by Paddle2See (July 20, 2018 15:06:06)




hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

Raytracing wrote:

DeleteThisAcount wrote:

ScratchDiogoh wrote:

I agree with the scratch wiki, because only scratchers can use cloud data7
I think the cloud data does not act differently.
in projects on other sites
(removed by moderator - please keep it polite)

-

On your computer scratch stores a cookie that contains if you are signed in or signed out, if you are a scratcher, a scratch team member of of you are a new scratcher.

What should happen is the embedded viewer reads that cookie and allowes for cloud data to work properly.

But because of the inconsistency of cloud data, there is no way to be sure that the embedded player will send and receive cloud data from the scratch servers 100% of the time.

If you would like a project that tests cloud data I would recommend making a project with a button that changes a cloud data variable up by 1. Open up this project in one tab, make sure you are signed in to a scratcher status account. Open up a new tab of a website with the scratch project embedded. If you don't have one, you can make a quick html webpage with just the embed code.

Scratch actually get info from /session/ which access is denied if the origin is not from scratch with specific headers, It is the website the page that sends that request not the project. So no you would not be able to. Also Scratch is linked to Websockets so its way harder. Only a lucky few know how to connect to cloud.

Thank you, Raytracing. That's very clarifying.
The wiki is indeed incorrect then. It must be rectified.
I wonder how many scratchers have tried to create an embedded cloud project, failed and thought they just couldn't code correctly, when the mistake is actually in the documentation. Not very pedagogical.
frodewin
Scratcher
500+ posts

Cloud Variables in embedded projetcs

Try to embed your project with sulfurous. It would be a different cloud value, since Sulfurous cannot access Scratch's cloud server, but it tries to provide a synronization for cloud variables between different sulfurous projects.



You can also find my best projects here or stop at my profile and say hi!
hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

I didn't know about this sulfurous. It might be the solution to all my problems. I'm trying it. Thanks
hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

DeleteThisAcount wrote:

Raytracing wrote:

DeleteThisAcount wrote:

ScratchDiogoh wrote:

I agree with the scratch wiki, because only scratchers can use cloud data7
I think the cloud data does not act differently.
in projects on other sites
(removed by moderator - please keep it polite)

-

On your computer scratch stores a cookie that contains if you are signed in or signed out, if you are a scratcher, a scratch team member of of you are a new scratcher.

What should happen is the embedded viewer reads that cookie and allowes for cloud data to work properly.

But because of the inconsistency of cloud data, there is no way to be sure that the embedded player will send and receive cloud data from the scratch servers 100% of the time.

If you would like a project that tests cloud data I would recommend making a project with a button that changes a cloud data variable up by 1. Open up this project in one tab, make sure you are signed in to a scratcher status account. Open up a new tab of a website with the scratch project embedded. If you don't have one, you can make a quick html webpage with just the embed code.

Scratch actually get info from /session/ which access is denied if the origin is not from scratch with specific headers, It is the website the page that sends that request not the project. So no you would not be able to. Also Scratch is linked to Websockets so its way harder. Only a lucky few know how to connect to cloud.

+1 forgot about the /session/ part

Do you know anyone of the mentioned “lucky feel”, DeleteThisAcount ?
I needed this embedded cloud data project to work in order to run a class experiment.
I would pay (not so much though) for having this done.
jokebookservice1
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

I think the embed view does not have cloud data functionality unfortunately, no. All other ways to view a project are protected with X-Frame-Options headers. All ways to set cloud variables external to projects is blocked by checking against the origin of requests. It used to be possible to send Websocket requests as the logged in user from an external site – this has now been patched.

So, there is no way to do what you want to do. But you could, for example, play a project in full-screen on the Scratch website for your class project?

Bribing Scratch with cookies or money won't work either, sorry.

Last edited by jokebookservice1 (July 22, 2018 21:27:42)

hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

jokebookservice1 wrote:

I think the embed view does not have cloud data functionality unfortunately, no. All other ways to view a project are protected with X-Frame-Options headers. All ways to set cloud variables external to projects is blocked by checking against the origin of requests. It used to be possible to send Websocket requests as the logged in user from an external site – this has now been patched.

So, there is no way to do what you want to do. But you could, for example, play a project in full-screen on the Scratch website for your class project?

Bribing Scratch with cookies or money won't work either, sorry.

“Bribing Scratch” ?
I would pay for a web developer to get an embedded cloud project to work (like it is supposed to, according to the documentation), not a “bribe” to a Scratch employee.
You got it wrong.
jokebookservice1
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

Either way – you can't get a normal browser running under normal settings to do this. If you have full control of the browser viewing the project, this might be possible however
_nix
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

hegenb wrote:

“Bribing Scratch” ?
I would pay for a web developer to get an embedded cloud project to work (like it is supposed to, according to the documentation), not a “bribe” to a Scratch employee.
You got it wrong.
I understand you would pay a developer to make a program that would work for you, but… there just probably aren't any programmers who would, or could, do this anyways. Keep in mind the vast majority of users on the site - even the majority of the ones you might find browsing the Advanced Topics subforum - are kids who probably don't have much, if any, experience with commissions regarding programming. (Probably most don't even have experience programming for someone other than themselves at all!)

A workaround like jokebookservice1 mentioned is probably your best bet:

jokebookservice1 wrote:

So, there is no way to do what you want to do. But you could, for example, play a project in full-screen on the Scratch website for your class project?

Exactly why do you need the project to be embedded? (You haven't explained in any of your posts so far.) If you are making a webpage which your students will view from their computers, you're probably best off, as suggested above, linking to the project in fullscreen. That's no more complicated than an “<a>” whose href is the URL of the project plus “#fullscreen”, e.g. https://scratch.mit.edu/projects/165451669/#fullscreen.

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

_nix wrote:

hegenb wrote:

“Bribing Scratch” ?
I would pay for a web developer to get an embedded cloud project to work (like it is supposed to, according to the documentation), not a “bribe” to a Scratch employee.
You got it wrong.
I understand you would pay a developer to make a program that would work for you, but… there just probably aren't any programmers who would, or could, do this anyways. Keep in mind the vast majority of users on the site - even the majority of the ones you might find browsing the Advanced Topics subforum - are kids who probably don't have much, if any, experience with commissions regarding programming. (Probably most don't even have experience programming for someone other than themselves at all!)

A workaround like jokebookservice1 mentioned is probably your best bet:

jokebookservice1 wrote:

So, there is no way to do what you want to do. But you could, for example, play a project in full-screen on the Scratch website for your class project?

Exactly why do you need the project to be embedded? (You haven't explained in any of your posts so far.) If you are making a webpage which your students will view from their computers, you're probably best off, as suggested above, linking to the project in fullscreen. That's no more complicated than an “<a>” whose href is the URL of the project plus “#fullscreen”, e.g. https://scratch.mit.edu/projects/165451669/#fullscreen.

Hi, _Nix

I need to project to be embedded because it is a sequence of various different projects, one leading to another. We're using webpages for that.

See an example here: http://democraciadigit.al/portugales/imp/tarefa4-1.html

After completing the first project, a message instructs the student to click the continue button (“Continuar”). This will take him to a page with the second project, and so on.

I need each project scores, for each student, to be saved somehow.


jokebookservice1
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

Sadly, embedding projects with cloud data could pose as a minor security hazard – so it isn't done.

You could, however, make a link that opens the project in a new tab.

Open <a href="https://scratch.mit.edu/projects/139040923/#fullscreen" target="_blank">my project</a>!

The only different bit to a normal link is

target="_blank"

You could then direct users to return to your website – and click the button to continue.

By the way, you can put images inside links. So, for example, you could place the preview image of a project on your page, and students can click on it to view your project in a new tab.

There are ways to achieve the exact effect you want, though. It's just that it's very very difficult to set up these methods, I'm afraid.

Last edited by jokebookservice1 (July 25, 2018 23:29:54)

hegenb
Scratcher
23 posts

Cloud Variables in embedded projetcs

I managed to put all the sequence in only one project and I'm using the fullscreen link tab as you said.
Thank you very much for your help.
Gabriel10Sonic
Scratcher
1 post

Cloud Variables in embedded projetcs

man.

We want cloud variables for embed projects.
Chiroyce
Scratcher
1000+ posts

Cloud Variables in embedded projetcs

Raytracing wrote:

Scratch actually get info from /session/ which access is denied if the origin is not from scratch with specific headers, It is the website the page that sends that request not the project. So no you would not be able to. Also Scratch is linked to Websockets so its way harder. Only a lucky few know how to connect to cloud.
Agreed, so it mostly will not work. Your browser only gives access to cookies to the page that set it.







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
AksharPremnath
Scratcher
500+ posts

Cloud Variables in embedded projetcs

You could use Turbowarp to embed a project with Cloud Variables.


szaheer27
Scratcher
4 posts

Cloud Variables in embedded projetcs

AksharPremnath wrote:

You could use Turbowarp to embed a project with Cloud Variables.
Elaborate, how?

Powered by DjangoBB