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

#326 2012-08-20 19:57:31

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: Scratch API 2.0

@head.php vs header.php Ah, I'm using header.php for all code above <body>.


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#327 2012-08-20 21:08:55

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

Re: Scratch API 2.0

Pitusky12 wrote:

bobbybee wrote:

I was the one that mentioned that security hole, right?

Hello,sorry for posting this here but im looking for the best scratchers in history,could you join my collab heres a link to it: http://scratch.mit.edu/forums/viewtopic.php?pid=1363435#p1363435
Post there.

Hey, around here, posting offtopic advertising is considered spam. Perhaps you should contact them on one of their projects or something.  smile

Offline

 

#328 2012-08-20 21:10:11

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: Scratch API 2.0

ProgrammingFreak wrote:

Pitusky12 wrote:

bobbybee wrote:

I was the one that mentioned that security hole, right?

Hello,sorry for posting this here but im looking for the best scratchers in history,could you join my collab heres a link to it: http://scratch.mit.edu/forums/viewtopic.php?pid=1363435#p1363435
Post there.

Hey, around here, posting offtopic advertising is considered spam. Perhaps you should contact them on one of their projects or something.  smile

oh okay,i deleted it.will you join? i need more people in my collab.Post there


Scratch 2.0 Beta Tester  wink

Offline

 

#329 2012-08-20 21:21:17

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

Re: Scratch API 2.0

Hey, sparks, could you update the main goals you have for 2.0 on the original post? That way other people can see right off the bat what this is about. And I'm kinda lazy so I don't want to go through 14 pages to catch up.  tongue

Offline

 

#330 2012-08-21 06:19:12

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

ProgrammingFreak wrote:

Hey, sparks, could you update the main goals you have for 2.0 on the original post? That way other people can see right off the bat what this is about. And I'm kinda lazy so I don't want to go through 14 pages to catch up.  tongue

Hehe, that would be a good idea, just like I updated my first post (albeit being the second post) to reflect a simple contents page. I think if you look through those you should get a glimpse of what it's about. or just visit api2.comeze.com  smile

Offline

 

#331 2012-08-21 06:44:15

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

I just had an idea!

I presume a very large portion of the images created on the site will be fairly process-expensive to generate (PHP's image library isn't very efficient and we do allow a lot of resizing, moving, etc).

We have no control over how many times a day these images would be generated, and for frequent posters with many posts scattered around highly viewed forums, these requests could become too many for the servers to handle.

Therefore, at the cost of some disk space (which we don't lack), we could save the images as PNGs and have the viewer fetch those instead of computing them at each request.

Even keeping our servers on 000wh, I expect to be able to allocate the space for at least one hundred thousand images (and leaving 500MB left over for stuff). What do you think?

EDIT
I should also mention that if we do exceed CPU limits on our current host, we're getting the site shut down without database or file recovery.

EDIT2
I completely forgot though, the whole point of a self updating image  tongue
I guess we could optimise it, but for now we would have to leave it like this.

Last edited by LS97 (2012-08-21 10:51:36)

Offline

 

#332 2012-08-21 12:19:49

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

Re: Scratch API 2.0

Yea, I was like PNG? I thought it was SULI?  tongue

Optimizing is fine, it's not going to be tooo complicated.


Hai.

Offline

 

#333 2012-08-21 16:14:06

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

Yay! I finished the parser/viewer of images!
fg123, you can test it manually if you wish by editing the elements table in phpmyadmin. I have thought of security and error handling too.

I implemented a censoring mechanism. Currently, no bad words are listed (to keep the code "clean") and two words are white listed: grape and skyscraper  tongue

URLs that lead to external images are also briefly checked for format and are replaced by a local "bad URL" image if they don't meet my reg exp.

size and position are replaced by defaults if bad format, and font name, size, etc do likewise.

***

Now, I will try myself to make a (maybe non-drag n drop) image editor so we can start using and testing the API.

I have two questions about the viewer though. First of all, what fonts should we support, and how should we implement the censoring? will we have the words right in the code, or will we fetch them from a database table?

Offline

 

#334 2012-08-21 17:50:27

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

Re: Scratch API 2.0

LS97 wrote:

ProgrammingFreak wrote:

Hey, sparks, could you update the main goals you have for 2.0 on the original post? That way other people can see right off the bat what this is about. And I'm kinda lazy so I don't want to go through 14 pages to catch up.  tongue

Hehe, that would be a good idea, just like I updated my first post (albeit being the second post) to reflect a simple contents page. I think if you look through those you should get a glimpse of what it's about. or just visit api2.comeze.com  smile

The site looks very nice.  smile

Offline

 

#335 2012-08-23 04:42:24

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

Re: Scratch API 2.0

Neat! There's been some good work here recently and I'm so sorry I don't have the time atm to help :'(

There was talk on the last page about me updating the first post to show a link to the site and some key aims of the project. I've done an update to the first post now but please feel free to suggest changes to it!


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

Offline

 

#336 2012-08-23 08:28:48

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: Scratch API 2.0

Which part of the login.php code authenticates using Scratch? I'm confused.  tongue


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#337 2012-08-23 08:33:02

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

sparks wrote:

Neat! There's been some good work here recently and I'm so sorry I don't have the time atm to help :'(

There was talk on the last page about me updating the first post to show a link to the site and some key aims of the project. I've done an update to the first post now but please feel free to suggest changes to it!

Nice! I think it neatly sums it up. However the bold tag didn't work.

Offline

 

#338 2012-08-23 08:34:36

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

technoboy10 wrote:

Which part of the login.php code authenticates using Scratch? I'm confused.  tongue

None. That's done during registration, and then the password is forgotten and all that's kept is the scratch user ID, which isn't even used in the login code.

Offline

 

#339 2012-08-27 12:37:30

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

Re: Scratch API 2.0

Mmhm, would you like the registering code as well?

Also, I'll be taking a look at your changes now, looks promising.  big_smile

Why is the creation date in Unix and not the standard mysql datetime?

Looks really nice! How did you do the edit/12, is it making a file each time or using Apache rewrite?

Last edited by fg123 (2012-08-27 12:54:14)


Hai.

Offline

 

#340 2012-08-27 17:32:26

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: Scratch API 2.0

fg123 wrote:

Mmhm, would you like the registering code as well?

Also, I'll be taking a look at your changes now, looks promising.  big_smile

Why is the creation date in Unix and not the standard mysql datetime?

Looks really nice! How did you do the edit/12, is it making a file each time or using Apache rewrite?

Are you talking to me?  tongue


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#341 2012-08-28 00:24:29

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

Re: Scratch API 2.0

technoboy10 wrote:

fg123 wrote:

Mmhm, would you like the registering code as well?

Also, I'll be taking a look at your changes now, looks promising.  big_smile

Why is the creation date in Unix and not the standard mysql datetime?

Looks really nice! How did you do the edit/12, is it making a file each time or using Apache rewrite?

Are you talking to me?  tongue

Yea, the register code part.


Hai.

Offline

 

#342 2012-08-28 08:39:56

technoboy10
Scratcher
Registered: 2007-08-25
Posts: 1000+

Re: Scratch API 2.0

fg123 wrote:

technoboy10 wrote:

fg123 wrote:

Mmhm, would you like the registering code as well?

Also, I'll be taking a look at your changes now, looks promising.  big_smile

Why is the creation date in Unix and not the standard mysql datetime?

Looks really nice! How did you do the edit/12, is it making a file each time or using Apache rewrite?

Are you talking to me?  tongue

Yea, the register code part.

Sure. I've got the authentication working, but I have no clue how to 'log in' a person.  tongue


So long, 1.4.
http://goo.gl/3JEV9

Offline

 

#343 2012-08-28 12:00:35

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

Re: Scratch API 2.0

Ah, basically, you store all the user details in the database when they register, and have it check the database to see if the user is in the database yet, if so, check their password. Since we are using MD5 as a hashing tool, passwords stored in the database are in MD5, therefore, we need to convert their entered password against the MD5 in the database. If you would like to do the authentication now, just perform it when the user is not found or the password is incorrect, as that means the user hasn't already been registered.


Hai.

Offline

 

#344 2012-09-04 11:20:42

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

fg123 wrote:

Mmhm, would you like the registering code as well?

Also, I'll be taking a look at your changes now, looks promising.  big_smile

Why is the creation date in Unix and not the standard mysql datetime?

Looks really nice! How did you do the edit/12, is it making a file each time or using Apache rewrite?

Sorry for the enormous time gap between your post and my reply! We have had serious internet problems and I haven't been on Scratch for weeks.

I just like unix timestamps better because I actually know how they work and PHP handles them really nicely. They're also easy to convert to human dates in the code and you can find the difference between two dates better.

edit/12 uses apache rewrite (at least I think it's that). Basically RewriteRules in HTACCESS that point to another page with a more informal GET variable  wink

Offline

 

#345 2012-09-17 12:12:38

iTweak0r
Scratcher
Registered: 2011-07-30
Posts: 100+

Re: Scratch API 2.0

I try making a user account there and it says: username cannot include special characters
but i didn't use any!


Make it in Scratch! because it's cooler when it's made in scratch
http://i.imgur.com/D4iqPHR.png

Offline

 

#346 2012-09-18 14:59:08

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

iTweak0r wrote:

I try making a user account there and it says: username cannot include special characters
but i didn't use any!

Maybe a 0 includes a special character?

Offline

 

#347 2012-09-23 23:02:43

iTweak0r
Scratcher
Registered: 2011-07-30
Posts: 100+

Re: Scratch API 2.0

LS97 wrote:

iTweak0r wrote:

I try making a user account there and it says: username cannot include special characters
but i didn't use any!

Maybe a 0 includes a special character?

i just tried "itweak" and it still didn't work!


Make it in Scratch! because it's cooler when it's made in scratch
http://i.imgur.com/D4iqPHR.png

Offline

 

#348 2012-09-24 03:06:04

cayun
New Scratcher
Registered: 2012-09-17
Posts: 1

Re: Scratch API 2.0

This sounds really great, guys. I can't wait for the release .

Offline

 

#349 2012-10-07 10:57:51

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Scratch API 2.0

iTweak0r wrote:

LS97 wrote:

iTweak0r wrote:

I try making a user account there and it says: username cannot include special characters
but i didn't use any!

Maybe a 0 includes a special character?

i just tried "itweak" and it still didn't work!

I got the same error, no useful explanation.

Tried clearing cache, cookies, and using a simpler username and password than I had been, but it didn't work.  I suppose I'm a special character  wink .

Last edited by LiquidMetal (2012-10-07 11:24:23)

Offline

 

#350 2012-10-10 16:32:11

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch API 2.0

Well, there might be a bug.
I really should finish this project off, shouldn't I...

Offline

 

Board footer