This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-05-20 17:50:51

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Web requests with Scratch 2.0

Abstract
Since Scratch 2.0 is online, why not add in the possibility of having HTTP requests? I would add in just POST and GET. That's the most used, and the other requests have not very much use for us Scratchers.

Suggested blocks
Note: Both blocks' dropdowns have [get, post] as values.

(request <- [get v] to [scratch.mit.edu])
Returns the result of the statement, in all text MIME types(that's not including images, svgs, etc until/if that's supported).
request -> [get v] to [scratch.mit.edu]
Just executes the statement without returning a result.

Example Uses
Now, why do you want to send requests to the web? Well... It just multiplies the uses of Scratch by x100. Anything that you can do on the web is now possible. It's even possible to create a simple web browser(without images, unless there's support for image blocks and creation and whatever).

I can think of several uses that use other programming language. Imagine you host a database on a website somewhere, and add in a PHP api, for requests such as "example.com/get.php?name=something&else=true". Bam, you can create forum software, multiplayer games, anything.

In fact, this principle applies anywhere where you want to store data that is much harder to see in a 1d structure as opposed to 2d(lists opposed to lists in lists). It's even possible to store data you don't necessarily want everyone to see. And it doesn't make the project any less open, because it's just data and not scripts.

tl;dr: Let's just add support for POST and GET. It's very useful.

Discuss.

Last edited by Greatdane (2012-05-20 17:51:52)


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#2 2012-05-20 18:01:22

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Web requests with Scratch 2.0

A few issues: WAY too complicated to a new Scratcher. It would be rather easy to kill bandwidth, honestly. Either way, it would be more effective to just make HTTP cloud-variables or whatever.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-05-20 18:05:19

Greatdane
Scratcher
Registered: 2007-06-05
Posts: 1000+

Re: Web requests with Scratch 2.0

bobbybee wrote:

A few issues: WAY too complicated to a new Scratcher. It would be rather easy to kill bandwidth, honestly. Either way, it would be more effective to just make HTTP cloud-variables or whatever.

I'm not sure it's that complicated. It's like saying, "Hey, you can just get the data of a website from a block!" I'm not sure about bandwith, though. What do you mean by HTTP cloud-variable?

Last edited by Greatdane (2012-05-20 18:05:51)


The future belongs to those who believe in the beauty of their dreams.
        ~ Eleanor Roosevelt

Offline

 

#4 2012-05-20 18:24:20

Kangahero
New Scratcher
Registered: 2012-05-17
Posts: 63

Re: Web requests with Scratch 2.0

I'm not sure I understand what this means... are you saying you could turn a Scratch game into holding data from another website? Like you could read something from another page?

1) I think that would take a while to work into Scratch
2) Think of how much data/space in a project it would take up: having to update to the site.

Offline

 

#5 2012-05-20 18:34:52

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: Web requests with Scratch 2.0

Greatdane wrote:

bobbybee wrote:

A few issues: WAY too complicated to a new Scratcher. It would be rather easy to kill bandwidth, honestly. Either way, it would be more effective to just make HTTP cloud-variables or whatever.

I'm not sure it's that complicated. It's like saying, "Hey, you can just get the data of a website from a block!" I'm not sure about bandwith, though. What do you mean by HTTP cloud-variable?

You think a new Scratcher knows what a GET request is? And about bandwidth, I mean a script like:

when gf clicked
forever
request [HTTP v] from [scratch.mit.edu]
end


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#6 2012-05-21 04:31:55

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Web requests with Scratch 2.0

I do not support.

It would be rather confusing for new Scratchers. Most have no idea what a GET or POST request is. Keep in mind that children who have no programming experience will be using Scratch.
It's also unnecessary, since Scratch is not intended for web programming.


http://trinary.tk/images/signature_.php

Offline

 

#7 2012-05-21 13:49:44

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Web requests with Scratch 2.0

I don't think you should be able to POST from Scratch. A drop too risky.  wink
But a (get contents of page [scratch.mit.edu]) would be great.

Offline

 

Board footer