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

#151 2010-12-22 15:19:32

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

sparks wrote:

Yes... I did

set t1 to line t3 of file at URL: http://scratch.mit.edu/users/sparks
set t2 to line t3 of file at URL: http://scratch.mit.edu/users/nonexistantuserthereisnocow
wait until key space pressed.

Then manually changed t3 until t1 and t2 were different. I started at 1 and the first time that they were different was line 3.

hmm.. how bout a picture of the script?

Sorry, i'm kinda visual.

Offline

 

#152 2010-12-22 15:30:16

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Welcome to your local block library! - Website development thread.

Updates:
- I am now using a MySQL database. I've figured it out  tongue


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#153 2010-12-22 15:32:38

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Daffy22 wrote:

Updates:
- I am now using a MySQL database. I've figured it out  tongue

good. now can yu either explain what sparks means or give me another job?

Offline

 

#154 2010-12-22 15:36:38

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Welcome to your local block library! - Website development thread.

ProgrammingFreak wrote:

Daffy22 wrote:

Updates:
- I am now using a MySQL database. I've figured it out  tongue

good. now can yu either explain what sparks means or give me another job?

ok. favicon. red background (same as L book in logo) mith the letter 'L' on it in white arial text. Search favicon generator in google to find a good convertor then email me it - daffy22scratch@gmail.com  smile

Last edited by Daffy22 (2010-12-22 15:36:50)


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#155 2010-12-22 15:39:13

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Daffy22 wrote:

ProgrammingFreak wrote:

Daffy22 wrote:

Updates:
- I am now using a MySQL database. I've figured it out  tongue

good. now can yu either explain what sparks means or give me another job?

ok. favicon. red background (same as L book in logo) mith the letter 'L' on it in white arial text. Search favicon generator in google to find a good convertor then email me it - daffy22scratch@gmail.com  smile

first:
I was talking about http://scratch.mit.edu/forums/viewtopic … 47#p629247

second:
Is that my job? I'll do it tommorow. I gtg

Offline

 

#156 2010-12-22 15:46:38

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Alrighty, since I have a little time, I'll make the favicon.

EDIT: http://prism-labs.com/stuff/sbl.ico Here.

Last edited by fg123 (2010-12-22 15:56:09)


Hai.

Offline

 

#157 2010-12-22 15:52:42

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Programming freak:

We want to be able to work out of a scratch username is valid or non-existant, right?

So we need to find a difference between the two. One difference is that if you type in a valid username such as this one into scratch, it will come up with their userpage wheras if the name does not exist such as this one It will display a different page saying that the page cannot be found. Knowing that there is this difference, we can assume that the HTML code for each of those two pages are different because they look different. One is full of projects and images, and the other is mostly blank.

So. To work out if a username is valid, we look for something in the HTML that appears the same with every user on Scratch but is not there or looks different for a username that is not found.

Comparing the two HTML codes for a page containing a found user and a page saying the user cannot be found side by side, I looked for the first difference in HTML there was. The first 5 lines for the HTML of a found page look like this:

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html dir="ltr"><head>
<meta name="google-site-verification" content="u33lYT_BSTmtVtHAe6kZgzxLgP5WtKTyfNy6svbv7jc" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="title" content="Scratch: Imagine, Program, Share"/>

while the first five lines of the HTML code for a userpage that does not exist is:

Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html dir="ltr">
<head>

Can you see that they're different? and can you see that the first and second line of both of them are the same but the third is different in each case?

This means that by checking whether the third line of the URL page http://scratch.mit.edu/users/$username looks like the third line of the verified user or the third line of the non existant user, we can work out if the user is real or not.

I physically cannot expain that in more depth  smile

The smalltalk code for a Panther block that does this would be

User $String$ exists?           b

|t2|
t2_ self readLine: 3 FromURL: 'http://scratch.mit.edu/users/', t1.
^ t2 = '<html dir="ltr"><head>'


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#158 2010-12-22 15:57:31

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

@sparks: There is actually another way of detecting it, but I guess your way works too. My personal preference is to use an api, like the one in Scratch Resources that connects to scratch's db and retrieves a list of usernames...

And how is the favicon? It's a first, I can try it with different colors or different styles...  smile

Last edited by fg123 (2010-12-22 15:58:00)


Hai.

Offline

 

#159 2010-12-22 16:00:28

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

This seems to have fallen out of sight, so I'll bring it up:

meowmeow55 wrote:

Another suggestion for the site: perhaps there could be a button that spawns more code boxes so that the user doesn't have to make dividers in 1 code box if the code goes in more than one place, and a separate title box for each one?
Quick mockup:

Code:

Where does this code go? (enter the path of where it is in Scratch's Squeak browser)
-------------------------------<box>------------------------------------------------
Code:
[
[
[---------------------------<large box>--------------------------------------------
[
[

[(button) Add another code location]
^this would spawn another form just like the one above

Yawn.

Offline

 

#160 2010-12-22 16:01:47

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

yes, I like that idea, meowmeow55!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#161 2010-12-22 16:02:54

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

That might work... We could also add a WYSIWYG editor for the code so it can be highlighted or such. And daffy, I would appreciate it if you could email me the ftp details for the current site @ prismlaboratories@gmail.com

I will move the code over.

Sparks, did you read my post before this?

Last edited by fg123 (2010-12-22 16:03:23)


Hai.

Offline

 

#162 2010-12-22 16:08:36

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Guys, goto webchat.freenode.com

use scratchusername as nickname and connect to the channel: scratchblocklibrary

We can discuss things faster that way.


Hai.

Offline

 

#163 2010-12-22 16:09:49

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

I did read it. I didn't know that was possible, and it's probably more reliable  tongue  I was just describing the method I myself used a while back to verify scratch usernames for a Panther project  smile


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#164 2010-12-22 16:15:33

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

I see. That might actually work. And can you connect to the irc channel?


Hai.

Offline

 

#165 2010-12-22 16:24:36

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

pardon?


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#166 2010-12-22 16:27:49

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

fg123 wrote:

Guys, goto webchat.freenode.com

use scratchusername as nickname and connect to the channel: scratchblocklibrary

We can discuss things faster that way.


Hai.

Offline

 

#167 2010-12-22 16:31:02

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

did you mean .net? I think I can get on.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#168 2010-12-22 16:33:30

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

how do I type?!


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#169 2010-12-22 16:38:15

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

In the box below.  tongue


Hai.

Offline

 

#170 2010-12-22 17:05:47

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

I don't think that that is really the best place to work on the development, people might miss info/be unable to view this page and it's nice to keep the development open-source  smile

Last edited by sparks (2010-12-22 17:06:01)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#171 2010-12-22 17:49:15

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: Welcome to your local block library! - Website development thread.

Well, for quick questions we can use that.  smile


Hai.

Offline

 

#172 2010-12-23 03:19:23

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Welcome to your local block library! - Website development thread.

fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.  smile
btw: nice favicon  tongue

Last edited by Daffy22 (2010-12-23 03:20:13)


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#173 2010-12-23 03:25:06

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Welcome to your local block library! - Website development thread.

As for meowmeow55's idea. I coud do this but we have to remember I seem to be doing most the coding, which I'm fine with, but to add something like this is very hard. I would have to rewrite the upload form. or would we just get it to 'join' them all together with a simple seperator?


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

#174 2010-12-23 09:25:51

pwiter
Scratcher
Registered: 2010-06-02
Posts: 100+

Re: Welcome to your local block library! - Website development thread.

Daffy22 wrote:

fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.  smile
btw: nice favicon  tongue

NO it's not, I can almost never access it!


http://i.imgur.com/YBeXc.png

Offline

 

#175 2010-12-23 09:40:31

Daffy22
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Welcome to your local block library! - Website development thread.

pwiter wrote:

Daffy22 wrote:

fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.  smile
btw: nice favicon  tongue

NO it's not, I can almost never access it!

what country do you live in?


http://img201.imageshack.us/img201/1784/logosmalle.png
"Spectacular - 5 Star" -  CNET.com Editor.

Offline

 

Board footer