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?
Offline
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!)
Offline
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
Offline
BUMP Up My Post!... And it would be good if the Scratch Team could answer this.
Offline
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.
Offline
...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...
Offline
Hardmath123 wrote:
...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...
exactly
I was in a rush, but that's what I was going to eventually suggest.
Offline
LS97 wrote:
Hardmath123 wrote:
...and since the rule for becoming a Scratcher relies on the number of projects and forum posts...
exactly
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.
Offline
So how many projects/forum posts does a New Scratch require to become a Scratcher?
Offline
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)
Offline
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.
Offline
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
Offline
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.
Offline
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.
Offline
Maybe you could use spark's API for checking if the user has one project at least...
Offline
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.
Offline
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.
![]()
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?
Offline
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.
![]()
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.
Offline
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.![]()
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.
![]()
IKR, especially PHP!
Offline
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.
![]()
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.
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)
Offline