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

#1 2012-07-13 07:36:36

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Scratch API Question...

Ok so I am making a website and I want users to to have to login with their Scratch account. (Scratch passwords will not be stored. Only their uploads will.) That is not the problem. I done a quick Google Search and found the API. The problem is that I want only Scratchers to be able to upload. Is their a way to detect if a user is a Scratcher or New Scratcher?


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#2 2012-07-13 13:40:22

Squawkers13
Scratcher
Registered: 2010-11-20
Posts: 500+

Re: Scratch API Question...

nathanprocks wrote:

Ok so I am making a website and I want users to to have to login with their Scratch account. (Scratch passwords will not be stored. Only their uploads will.) That is not the problem. I done a quick Google Search and found the API. The problem is that I want only Scratchers to be able to upload. Is their a way to detect if a user is a Scratcher or New Scratcher?

Wow. I need this thread.
(as in, I want to try to do that!)


http://pekkit.net/banners/pekkit.png

Offline

 

#3 2012-07-13 21:43:07

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

Squawkers13 wrote:

nathanprocks wrote:

Ok so I am making a website and I want users to to have to login with their Scratch account. (Scratch passwords will not be stored. Only their uploads will.) That is not the problem. I done a quick Google Search and found the API. The problem is that I want only Scratchers to be able to upload. Is their a way to detect if a user is a Scratcher or New Scratcher?

Wow. I need this thread.
(as in, I want to try to do that!)

You mean make a login with Scratch thing? http://scratch.mit.edu/api/authenticate … demo%23123


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#4 2012-07-14 06:52:07

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

BUMP Up My Post!... And it would be good if the Scratch Team could answer this.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#5 2012-07-14 09:53:45

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

Re: Scratch API Question...

There isn't any easy way of finding this -- everything is possible of course; if you can find one of their posts using the search feature and then parse the HTML to find the text "Scratcher" or "New Scratcher".

However what you can easily do (and what I have already done in the past) is check how many projects they have, and whether they have forum posts.  smile

Offline

 

#6 2012-07-14 10:02:54

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch API Question...

...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#7 2012-07-14 10:49:02

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

Re: Scratch API Question...

Hardmath123 wrote:

...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...

exactly  smile  I was in a rush, but that's what I was going to eventually suggest.

Offline

 

#8 2012-07-14 11:06:38

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Scratch API Question...

LS97 wrote:

Hardmath123 wrote:

...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...

exactly  smile  I was in a rush, but that's what I was going to eventually suggest.

actually, forum posts don't matter.
But I'm sorta thinking of making a database that would do what LS suggested:  look for their posts, and find out if they are a new Scratcher or a Scratcher, then save it to a database. If they are a New Scratcher, it would query the page each day to see if they are updated to Scratcher. Then other websites could simply do something like file_get_contents(somewebsite.tk/user.php?query=whatever) to find out if that person was a Scratcher or not.


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#9 2012-07-15 05:15:53

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

So how many projects/forum posts does a New Scratch require to become a Scratcher?


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#10 2012-07-15 05:53:49

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch API Question...

nathanprocks wrote:

So how many projects/forum posts does a New Scratch require to become a Scratcher?

You need 3+ projects, 10+ comments, and must have joined a month ago. I said forum posts because obviously it doesn't matter if the Scratcher hasn't been on the forums anyway.(reference)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#11 2012-07-15 06:52:14

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

If someone could write a PHP script to check if a user is a Scratcher or New Scratcher (or maybe just if the user is not a New Scratcher so it works for mods and the ST), that would help a lot. The script would only run once because the username and scratcher status would be stored in the database.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#12 2012-07-15 07:31:45

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: Scratch API Question...

nathanprocks wrote:

If someone could write a PHP script to check if a user is a Scratcher or New Scratcher (or maybe just if the user is not a New Scratcher so it works for mods and the ST), that would help a lot. The script would only run once because the username and scratcher status would be stored in the database.

Ah, but if a user is a New Scratcher, that user may be promoted to Scratcher sometime, so, ideally, you should run it in a cron job


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#13 2012-07-15 07:55:37

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

SJRCS_011 wrote:

nathanprocks wrote:

If someone could write a PHP script to check if a user is a Scratcher or New Scratcher (or maybe just if the user is not a New Scratcher so it works for mods and the ST), that would help a lot. The script would only run once because the username and scratcher status would be stored in the database.

Ah, but if a user is a New Scratcher, that user may be promoted to Scratcher sometime, so, ideally, you should run it in a cron job

I mean't that the user can only sign up if they are not a New Scratcher.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#14 2012-07-15 08:01:52

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Scratch API Question...

this is the script the forums use to update users


http://i.imgur.com/1QqnHxQ.png

Offline

 

#15 2012-07-15 08:10:20

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

TRocket wrote:

this is the script the forums use to update users

I know that, but I am unsure on how to check if the account is 30 or more days old and have been active within the last 2 days.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#16 2012-07-15 08:22:54

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Scratch API Question...

Maybe you could use spark's API for checking if the user has one project at least...


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#17 2012-07-15 08:29:00

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

jji7skyline wrote:

Maybe you could use spark's API for checking if the user has one project at least...

I can use the ScratchR API for that, but I need to check if the user's account is at least 30 days old and have been active within the past 2 days.  hmm


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#18 2012-07-15 09:16:21

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Scratch API Question...

nathanprocks wrote:

jji7skyline wrote:

Maybe you could use spark's API for checking if the user has one project at least...

I can use the ScratchR API for that, but I need to check if the user's account is at least 30 days old and have been active within the past 2 days.  hmm

there's no way of finding when the account was created as far as i know, but you could cheat and find the date the user's first project was uploaded?


http://i.imgur.com/1QqnHxQ.png

Offline

 

#19 2012-07-15 09:28:15

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

TRocket wrote:

nathanprocks wrote:

jji7skyline wrote:

Maybe you could use spark's API for checking if the user has one project at least...

I can use the ScratchR API for that, but I need to check if the user's account is at least 30 days old and have been active within the past 2 days.  hmm

there's no way of finding when the account was created as far as i know, but you could cheat and find the date the user's first project was uploaded?

I guess I could but I just hate using date and time functions in programming.  tongue


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#20 2012-07-15 09:30:45

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Scratch API Question...

nathanprocks wrote:

TRocket wrote:

nathanprocks wrote:


I can use the ScratchR API for that, but I need to check if the user's account is at least 30 days old and have been active within the past 2 days.  hmm

there's no way of finding when the account was created as far as i know, but you could cheat and find the date the user's first project was uploaded?

I guess I could but I just hate using date and time functions in programming.  tongue

IKR, especially PHP!


http://i.imgur.com/1QqnHxQ.png

Offline

 

#21 2012-07-15 09:36:32

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Scratch API Question...

TRocket wrote:

nathanprocks wrote:

TRocket wrote:

there's no way of finding when the account was created as far as i know, but you could cheat and find the date the user's first project was uploaded?

I guess I could but I just hate using date and time functions in programming.  tongue

IKR, especially PHP!

Ok, thanks for helping. I might try this tomorrow when I have all day to use the library's free WiFi hotspot.  tongue  It is 10:36 here and my mum keeps telling me to hurry up and go to bed lol.

Last edited by nathanprocks (2012-07-15 09:37:12)


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

Board footer