You send the post data (containing the block name, username, password, block info and anything else needed to recreate the block file and credit it at the other end) to a .php page on the block library site. A PHP script can then read this data and store the information in a database, verify the username and password, create a block file etc.
Offline
sparks wrote:
You send the post data (containing the block name, username, password, block info and anything else needed to recreate the block file and credit it at the other end) to a .php page on the block library site. A PHP script can then read this data and store the information in a database, verify the username and password, create a block file etc.
You were worried about the password not being encrypted? There is a block in the block library like this: 'password for %s is %s?'. I could use that method, and then the block importer just sends the account name if the password is correct, I'll make the security in the source code so that one can't modify the uploading code. So it just posts the block name, username, comment, and the file. I'll need a little help knowing how the request should be formatted and sent.
Offline
You can certainly use the password block from the library, but the password isn't encrypted when it's sent through that either!
The encryption isn't too important though, since the password is never stored and the scratchblocks site is pretty secure.
Offline
sparks wrote:
You can certainly use the password block from the library, but the password isn't encrypted when it's sent through that either!
The encryption isn't too important though, since the password is never stored and the scratchblocks site is pretty secure.
Ok, what we don't want is impersonation. Without the password, anybody could just post a block under someone else's name with say, a bad word or something.
Do you know anyone else who could help me with the upload a block feature?
Oh, and about the args, (%s = $String$, %n = $Number$), do you know where the methods for the arg parsing are located in panther? It would be cool to use this, as it is more efficient.
Offline
I agree that a username and password should be needed to share a block for exactly the reasons you put above.
I'm afraid I don't know where the method is, but I DO have a list of all Panther arguments if it's any help. I wrote a squeak tutorial a long time ago on the Scratch Wiki:
Arguments list
Offline
sparks wrote:
I agree that a username and password should be needed to share a block for exactly the reasons you put above.
I'm afraid I don't know where the method is, but I DO have a list of all Panther arguments if it's any help. I wrote a squeak tutorial a long time ago on the Scratch Wiki:
Arguments list
With the argument words added, and the share a block, I think the patch would be perfect. Have you tried it?
Offline
Erm, how will using word args work in Scratch? Would your patch effectively replace all existing args with word args? That could seriously confuse new dabblers...
I haven't tried it yet, I can't get it to work! I copied the contents of the text argument, opened a workspace, pasted it in, accepted it and filed it in but nothing happened, no new menus or anything!
I should point out that BYOB and Panther support is something you can develop if you wish, but not something the library would use. We already have block files for Panther and sprite files containing custom blocks for BYOB (though now I come to think of it, a patch for Panther to import blocks by number from the library would be pretty neat).
Offline
sparks wrote:
Erm, how will using word args work in Scratch? Would your patch effectively replace all existing args with word args? That could seriously confuse new dabblers...
I haven't tried it yet, I can't get it to work! I copied the contents of the text argument, opened a workspace, pasted it in, accepted it and filed it in but nothing happened, no new menus or anything!
I should point out that BYOB and Panther support is something you can develop if you wish, but not something the library would use. We already have block files for Panther and sprite files containing custom blocks for BYOB (though now I come to think of it, a patch for Panther to import blocks by number from the library would be pretty neat).
Yes. When the patch is installed I have to replace the block specs, because this code has to be added: , (CustomBlockSpecsDictionary formatAsArrayFor: 'All'). I could just as well replace all the args. uncoloredArgMorphsFor: also has to be replace to support custom args.
New dabblers.. hmmm... I never thought about that. How could I implement the word args. It's very efficient, but not many people know a lot about it, and some, as you say, may be confused. If they're confused they should probably ask me.
Are you sure nothing appears after you file-in the patch? You have to select 'save image for end-user' to save and rebuild the menu panels, ('file edit help'), then the 'blocks' menu will show up, did you do that?
As for Panther and BYOB, I was thinking of making a block importer that's compatible with them too, plus exporting custom blocks (BYOB and CYOB) compatible with the scratch block importer.
Isn't there already a 'download $Number$ block from library' block?
Offline
I'm worried that someone will start exploring the browser in Scratch and see $Word$ arguments, then they'll try and do it in an unpatched version of Scratch and get very confused about the %l arguments. However, I suppose it could be mentioned as a patch feature on the patch downloader. I think we'll also supply a download for a copy of the Scratch image that has been patched for the use of people who can't, won't or don't want to file the patch in themselves.
I'll have another go at running it, I did save image for end user last time and saw no change...
The thing is, I don't really see the use of a block importer for BYOB or Panther... Panther has a custom blocks system already, which works quite well and doesn't actually involve browser edits, meaning blocks are stored in project files, letting them work in all copies. The block downloader reads a file containing the block spec, colour, author and method from a file hosted by me, then uses a smalltalk script created by MathWizz to add the block to the custom blocks list. This is, of course, yours to use if you want to.
Offline
sparks wrote:
I'm worried that someone will start exploring the browser in Scratch and see $Word$ arguments, then they'll try and do it in an unpatched version of Scratch and get very confused about the %l arguments. However, I suppose it could be mentioned as a patch feature on the patch downloader. I think we'll also supply a download for a copy of the Scratch image that has been patched for the use of people who can't, won't or don't want to file the patch in themselves.
I'll have another go at running it, I did save image for end user last time and saw no change...
The thing is, I don't really see the use of a block importer for BYOB or Panther... Panther has a custom blocks system already, which works quite well and doesn't actually involve browser edits, meaning blocks are stored in project files, letting them work in all copies. The block downloader reads a file containing the block spec, colour, author and method from a file hosted by me, then uses a smalltalk script created by MathWizz to add the block to the custom blocks list. This is, of course, yours to use if you want to.
You're right, I should also make an image, and I should mention the $word$ arguments as a feature. I already have a download block feature, it's the same as the importer only it imports from an url. I think panther is amazing, by the way. My favorite things are CYOB and the color blocks. Once I ALMOST entirely ported the color blocks to the scratch source code, the only problem was that it couldn't save properly.
Offline
I'm glad you like Panther, we worked for a long time on it I think the colour functionality (on top of the webcam connection) as well as custom blocks are its most powerful tools, I've used to make learning scripts that recognise different country flags for my artificial intelligence coursework!
Offline
So if you're agreeable, and could post an image file for sharing, I'd like to update the Scratch>control section of the block library to this new format to see how it would all look! Could you share the .block files for Scratch>control that you have finished making? I'll take them and rehost them on the blocks.scratchr site so you can just post the file code in a post and I'll upload them as .block files if that's easier for you.
Offline
sparks wrote:
So if you're agreeable, and could post an image file for sharing, I'd like to update the Scratch>control section of the block library to this new format to see how it would all look! Could you share the .block files for Scratch>control that you have finished making? I'll take them and rehost them on the blocks.scratchr site so you can just post the file code in a post and I'll upload them as .block files if that's easier for you.
YES! Thank you. There are a few bugs in the newest block importer that I have to clear up first, but I can give you the files for motion and the controls ones I've made.
Offline
I'm gonna use pseudo code here, cos I've not used smalltalk in a long time, but have you considered doing something like this?:
in the patch:
create a file called version.txt add 1.0 to line 1 (The current version) add 1.0 to line 2 (The last version it was updated at)
in the Scratch startup script:
try to connect to http://www.blocks.scratchr.org/blockFiles/newestVersion.php and then read the version number from that page using readfromURL. (page doesn't exist atm) compare the read version number against the version.txt line 1 if(newestVersion > version.txtLine1 && newestVersion > version.txtLine2){ display a popup asking if they want to install the new version if(yes selected){ read latest patch from http://www.blocks.scratchr.org/blockFiles/newestPatch.php file this in restart Scratch } else{ change line 2 of version.txt to latestVersion so that they aren't asked again if they wish to update until another patch comes out } }
Offline
sparks wrote:
I'm gonna use pseudo code here, cos I've not used smalltalk in a long time, but have you considered doing something like this?:
in the patch:Code:
create a file called version.txt add 1.0 to line 1 (The current version) add 1.0 to line 2 (The last version it was updated at)in the Scratch startup script:
Code:
try to connect to http://www.blocks.scratchr.org/blockFiles/newestVersion.php and then read the version number from that page using readfromURL. (page doesn't exist atm) compare the read version number against the version.txt line 1 if(newestVersion > version.txtLine1 && newestVersion > version.txtLine2){ display a popup asking if they want to install the new version if(yes selected){ read latest patch from http://www.blocks.scratchr.org/blockFiles/newestPatch.php file this in restart Scratch } else{ change line 2 of version.txt to latestVersion so that they aren't asked again if they wish to update until another patch comes out } }
I think I should incorporate that in the patch, but it shouldn't be in the startup. In panther, as you know, when you start up a dialog shows up titled: 'Panther News', which gets contents from an url. A few times, when I lost internet, I tried to use panther, but it got stuck on the 'connecting...' thing, so I couldn't start panther because I had no internet at the moment. I think there should be a label in the blocks menu called: 'Update Block Importer' , version. Basically, 'Update Block Importer ' combined with the version.
Offline
dreamod wrote:
sparks wrote:
Okay, that sounds like a good solution!
Could you post the block files you've done for the Control section?Actually, with the word args, I have to start over, but that's not too bad.
Find and replace?
Offline
sparks wrote:
dreamod wrote:
sparks wrote:
Okay, that sounds like a good solution!
Could you post the block files you've done for the Control section?Actually, with the word args, I have to start over, but that's not too bad.
Find and replace?
I'm going to start over, I'm working on completing the final patch, it's almost done. I've also made a Mac OS X Block Importer 2.0 VM. Basically, an edit of the Scratch application, except with the 'info.plist' edited. I've fixed a few glitches and it's almost completely done.
Offline
That's cool
Is the patch removeable? It's something you might want to think about in case someone doesn't want it anymore. Remember the patch might mess up any custom blocks they added to their copy of Scratch beforehand if arguments are shared or because of the $words$.
Offline
sparks wrote:
That's cool
Is the patch removeable? It's something you might want to think about in case someone doesn't want it anymore. Remember the patch might mess up any custom blocks they added to their copy of Scratch beforehand if arguments are shared or because of the $words$.
My advice to anybody who installs this patch is: before you install the patch, backup the image, make sure you have an extra copy, in case you're not satisfied.
Offline