Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » API for uploading projects?
- gtoal
-
Scratcher
1000+ posts
API for uploading projects?
So I can now download a project, unpack it, make modifications to the code, recreate the json, and zip it back up… But how do I upload the modified file to replace the original? (Actually I'd be happy with just uploading modified json if that's easier, I don't want to alter other resources)
Having worked out today how to log in and handle Scratch's cookies using cURL, I probably have the components I need, if I knew the details of the API. All I could find in the forums was how to download, not how to upload.
Thanks,
Graham
Having worked out today how to log in and handle Scratch's cookies using cURL, I probably have the components I need, if I knew the details of the API. All I could find in the forums was how to download, not how to upload.
Thanks,
Graham
- gtoal
-
Scratcher
1000+ posts
API for uploading projects?
https://github.com/bobbybee/scratch-llvm/blob/master/meow.js#L48-L72
Neat! All the info right there in one function. Thanks.
So there are /set URLs that correspond to the /get URLs…
G
- blob8108
-
Scratcher
1000+ posts
API for uploading projects?
Note that this is probably against the Terms of Use:
4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
- MegaApuTurkUltra
-
Scratcher
1000+ posts
API for uploading projects?
Note that this is probably against the Terms of Use:4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
This isn't a “modified version of the scratch editor” - I'm assuming it isn't even ASYou may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
Last edited by MegaApuTurkUltra (Nov. 13, 2014 19:57:14)
- gtoal
-
Scratcher
1000+ posts
API for uploading projects?
Note that this is probably against the Terms of Use:4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
I read a post by lightnin' somewhere that said that as long as it didn't involve hacks - edited json that *could* have been created by the Scratch editor was just fine and encouraged. It was hacked blocks that couldn't be created by any user that they had a problem with. I don't plan to do that, I want to write/modify regular Scratch code. You can already do this but you have to save it as an sb2 then use the editor to upload the sb2. An extra and unnecessary step…
Ah, here we are…
But as for making scripts by hacking the JSON that *can* be accurately represented / recreated in the editor - knock yourself out!- http://scratch.mit.edu/discuss/topic/1810/?page=1#post-11347
Last edited by gtoal (Nov. 13, 2014 20:21:30)
- gtoal
-
Scratcher
1000+ posts
API for uploading projects?
This isn't a “modified version of the scratch editor” - I'm assuming it isn't even AS
OK, I was going to keep this under my hat until I'd actually tried coding some of it, but what I'm thinking about is doing a static binary translation of some video games to Scratch. The projects are just not practical to write by hand. I have existing C code that currently outputs C (in fact a java-compatible subset of C) and it shouldn't be a problem to format the output as scratchblocks or even go directly to json.
The generated code currently looks something like this: http://www.gtoal.com/athome/tailgunner/gp32/ops0000.c
I hadn't considered doing a scratch version due to the lack of switch labels, but “Robert'); DROP TABLE Students;–” showed how that limitation can be worked around in his C to Scratch converter…
From experience I know you need a tight compile/edit/run loop and saving an sb2 from my unix system to my pc and uploading via the editor is just way too slow, hence the interest in going straight from code generation to uploaded project.
Graham
- blob8108
-
Scratcher
1000+ posts
API for uploading projects?
You can already do this but you have to save it as an sb2 then use the editor to upload the sb2. An extra and unnecessary step…Right, but an important distinction: *creating* projects with external tools is encouraged; writing tools to *upload* then is not. It'd be a good idea to check with the ST that it's okay.
From experience I know you need a tight compile/edit/run loop and saving an sb2 from my unix system to my pc and uploading via the editor is just way too slow, hence the interest in going straight from code generation to uploaded project.Um. If all you want to do is test an sb2 file, why can't you just use the offline editor?
Cool project though!
- MegaApuTurkUltra
-
Scratcher
1000+ posts
API for uploading projects?
You can already do this but you have to save it as an sb2 then use the editor to upload the sb2. An extra and unnecessary step…Right, but an important distinction: *creating* projects with external tools is encouraged; writing tools to *upload* then is not. It'd be a good idea to check with the ST that it's okay.From experience I know you need a tight compile/edit/run loop and saving an sb2 from my unix system to my pc and uploading via the editor is just way too slow, hence the interest in going straight from code generation to uploaded project.Um. If all you want to do is test an sb2 file, why can't you just use the offline editor?
Cool project though!
Read please /\This isn't a “modified version of the scratch editor” - I'm assuming it isn't even ASYou may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
This seems like it doesn't fall under the category.
- blob8108
-
Scratcher
1000+ posts
API for uploading projects?
No, but neither is it “(1) the Scratch website editor or (2) an unmodified copy of the Scratch editor”. See the first sentence of 4.4.This isn't a “modified version of the scratch editor”4.4 You may only submit user-generated projects that were created with (1) the Scratch website editor or (2) an unmodified copy of the Scratch editor compiled from the source code described in Section 5.3. You may not upload any projects that were created, by you or by anyone else, with a modified version of the Scratch editor.
Regardless, even if you do read the rule as ambiguous, the intent seems clear: don't upload projects except using unmodified Scratch. And it never hurts to ask first

- gtoal
-
Scratcher
1000+ posts
API for uploading projects?
Regardless, even if you do read the rule as ambiguous, the intent seems clear: don't upload projects except using unmodified Scratch. And it never hurts to ask first
OK guys, I didn't mean for this to be such a big deal. If I ever get to the stage of being ready to do this, I'll check with the Scratch team first, however I have to confess that I had indeed forgotten about the offline editor, since I hadn't used it since Scratch 1.4. I guess I thought with the 2.0 system being web based, that the downloadable editor had gone away. So I probably won't need to upload projects after all (unless I just try it for the intellectual curiosity of knowing how to do it)
However I was reading the comments in @MegaApuTurkUltra's profile and it looks like the ST isn't very responsive (even to urgent security issues); in fact since Lightnin left, I'm not at all sure how you go about contacting them?
G
- nathanprocks
-
Scratcher
1000+ posts
API for uploading projects?
Lightnin left? What does he do now? I probably read about it somewhere before and forgot about it.Regardless, even if you do read the rule as ambiguous, the intent seems clear: don't upload projects except using unmodified Scratch. And it never hurts to ask first
OK guys, I didn't mean for this to be such a big deal. If I ever get to the stage of being ready to do this, I'll check with the Scratch team first, however I have to confess that I had indeed forgotten about the offline editor, since I hadn't used it since Scratch 1.4. I guess I thought with the 2.0 system being web based, that the downloadable editor had gone away. So I probably won't need to upload projects after all (unless I just try it for the intellectual curiosity of knowing how to do it)
However I was reading the comments in @MegaApuTurkUltra's profile and it looks like the ST isn't very responsive (even to urgent security issues); in fact since Lightnin left, I'm not at all sure how you go about contacting them?
G

The best way to contact them is probably to use the ‘Contact Us’ button at the bottom of the page isn't it? Or you could comment on one of their profiles.
- djdolphin
-
Scratcher
1000+ posts
API for uploading projects?
He hasn't left yet. He got a job with LEGO, and he's moving to Denmark in 2015.⁽¹⁾Lightnin left? What does he do now? I probably read about it somewhere before and forgot about it.Regardless, even if you do read the rule as ambiguous, the intent seems clear: don't upload projects except using unmodified Scratch. And it never hurts to ask first
OK guys, I didn't mean for this to be such a big deal. If I ever get to the stage of being ready to do this, I'll check with the Scratch team first, however I have to confess that I had indeed forgotten about the offline editor, since I hadn't used it since Scratch 1.4. I guess I thought with the 2.0 system being web based, that the downloadable editor had gone away. So I probably won't need to upload projects after all (unless I just try it for the intellectual curiosity of knowing how to do it)
However I was reading the comments in @MegaApuTurkUltra's profile and it looks like the ST isn't very responsive (even to urgent security issues); in fact since Lightnin left, I'm not at all sure how you go about contacting them?
G
The best way to contact them is probably to use the ‘Contact Us’ button at the bottom of the page isn't it? Or you could comment on one of their profiles.
Y U NO HAVE SUPERSCRIPT SQUARE BRACKETS, UNICODE?
Last edited by djdolphin (Nov. 15, 2014 01:27:44)
- MegaApuTurkUltra
-
Scratcher
1000+ posts
API for uploading projects?
Aww I'll be sad to see Lightnin leave.He hasn't left yet. He got a job with LEGO, and he's moving to Denmark in 2015.⁽¹⁾Lightnin left? What does he do now? I probably read about it somewhere before and forgot about it.Regardless, even if you do read the rule as ambiguous, the intent seems clear: don't upload projects except using unmodified Scratch. And it never hurts to ask first
OK guys, I didn't mean for this to be such a big deal. If I ever get to the stage of being ready to do this, I'll check with the Scratch team first, however I have to confess that I had indeed forgotten about the offline editor, since I hadn't used it since Scratch 1.4. I guess I thought with the 2.0 system being web based, that the downloadable editor had gone away. So I probably won't need to upload projects after all (unless I just try it for the intellectual curiosity of knowing how to do it)
However I was reading the comments in @MegaApuTurkUltra's profile and it looks like the ST isn't very responsive (even to urgent security issues); in fact since Lightnin left, I'm not at all sure how you go about contacting them?
G
The best way to contact them is probably to use the ‘Contact Us’ button at the bottom of the page isn't it? Or you could comment on one of their profiles.
Y U NO HAVE SUPERSCRIPT SQUARE BRACKETS, UNICODE?
Y U no have actual useful markup, bbcode?*
- Discussion Forums
- » Advanced Topics
-
» API for uploading projects?

