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
Daffy22 wrote:
Updates:
- I am now using a MySQL database. I've figured it out![]()
good. now can yu either explain what sparks means or give me another job?
Offline
ProgrammingFreak wrote:
Daffy22 wrote:
Updates:
- I am now using a MySQL database. I've figured it out![]()
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
Last edited by Daffy22 (2010-12-22 15:36:50)
Offline
Daffy22 wrote:
ProgrammingFreak wrote:
Daffy22 wrote:
Updates:
- I am now using a MySQL database. I've figured it out![]()
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
![]()
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
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:
<!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:
<!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
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>'
Offline
@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...
Last edited by fg123 (2010-12-22 15:58:00)
Offline
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
Offline
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)
Offline
I did read it. I didn't know that was possible, and it's probably more reliable
I was just describing the method I myself used a while back to verify scratch usernames for a Panther project
Offline
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
Last edited by sparks (2010-12-22 17:06:01)
Offline
fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.
btw: nice favicon
Last edited by Daffy22 (2010-12-23 03:20:13)
Offline
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?
Offline
Daffy22 wrote:
fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.
![]()
btw: nice favicon![]()
NO it's not, I can almost never access it!
Offline
pwiter wrote:
Daffy22 wrote:
fg123, we're not moving. I've already set up my SQL database. Please. Freehostingcloud is fine.
![]()
btw: nice favicon![]()
NO it's not, I can almost never access it!
what country do you live in?
Offline