Discuss Scratch

wizzwizz7
Scratcher
500+ posts

Love and Favourite Detector in Projects

I thought that perhaps there could be a love and favourite detector. So, for example, you could have something like this:
if <(username) has [loved v] this project> then
say [Thanks for loving!]
else
say [y u no gimmeh teh luv???]
end
Approach A:
Since Scratch's JSON is basically Javascript, we could somehow get data from the project page. This would also tell us how many loves the project would have.

Approach B:
We could have some sort of method where if the mouse is down and it's on the bottom of the project display and its x position is where the favourite and love buttons are, it would add the username of the person who loved and favourited onto a list.

Personally, I think that approach A would be more reliable. But what do you guys think? Would it actually be possible…?



DrKat123
Scratcher
1000+ posts

Love and Favourite Detector in Projects

I don't think this is possible

Moving from Scratch? Don't learn C or Java, try Snap!
it haz OOP
DrKat McKatFace
First of all I'm 100% human and humans does not have a cat face
and second, the Boaty McBoatFace/Parsey McParseFace madness has just begun

λ
Sharp, my new Scratch mod
Is my post/siggy worthy for an internet?
fredfish10
Scratcher
100+ posts

Love and Favourite Detector in Projects

It might be if you kept a log of the mouses co-ordinates

Search this into google for all my posts
^?|\!@$&^$ WO___+_??<?>>±±±±§§&L:{)|+}{{}{"LI765$£@2
liam48D
Scratcher
1000+ posts

Love and Favourite Detector in Projects

The problem is I don't think who loved (or favourited) a project can be found out in any way through the site (or the API).

202e-202e-202e-202e-202e UNI-CODE~~~~~
scratchyone
Scratcher
100+ posts

Love and Favourite Detector in Projects

You could, but it would be hard. Every time somebody used the project, you would encode their username and save it in a cloud var. Then an external program would have an account follow that user. Then, you could check that accounts messages to see if it says “Username” favorited project, and send that back in a cloud var.
Dylan5797
Scratcher
1000+ posts

Love and Favourite Detector in Projects

wizzwizz7 wrote:

I thought that perhaps there could be a love and favourite detector. So, for example, you could have something like this:
if <(username) has [loved v] this project> then
say [Thanks for loving!]
else
say [y u no gimmeh teh luv???]
end
Approach A:
Since Scratch's JSON is basically Javascript, we could somehow get data from the project page. This would also tell us how many loves the project would have.

Approach B:
We could have some sort of method where if the mouse is down and it's on the bottom of the project display and its x position is where the favourite and love buttons are, it would add the username of the person who loved and favourited onto a list.

Personally, I think that approach A would be more reliable. But what do you guys think? Would it actually be possible…?
You can't exactly run JavaScript in scratch, but you might be able to hack a costume under the favorite button (maybe)







im so ocd about ip addresses


can you guess what my user icon is

new record


dylan beswick · writing · github · soundcloud

I enjoy coding, writing electronic music, building computers and servers, and playing the piano. I am a big fan of F-777's music, you should really check it out.

I have written a few semi-common pieces of code that are used in scratch projects, like scratchapi.

I'm kind of lonely, I'd like a bit of attention, if that's possible.












i maxed out geoguessr at 25,000 points – https://geoguessr.com/results/GiXQHzXVQSEeWiYT
i truly feel sorry for everybody else in my country
wizzwizz7
Scratcher
500+ posts

Love and Favourite Detector in Projects

Dylan5797 wrote:

wizzwizz7 wrote:

I thought that perhaps there could be a love and favourite detector. So, for example, you could have something like this:
if <(username) has [loved v] this project> then
say [Thanks for loving!]
else
say [y u no gimmeh teh luv???]
end
Approach A:
Since Scratch's JSON is basically Javascript, we could somehow get data from the project page. This would also tell us how many loves the project would have.

Approach B:
We could have some sort of method where if the mouse is down and it's on the bottom of the project display and its x position is where the favourite and love buttons are, it would add the username of the person who loved and favourited onto a list.

Personally, I think that approach A would be more reliable. But what do you guys think? Would it actually be possible…?
You can't exactly run JavaScript in scratch, but you might be able to hack a costume under the favorite button (maybe)
Ooh, nice idea.



Gaza101
Scratcher
500+ posts

Love and Favourite Detector in Projects

scratchyone wrote:

You could, but it would be hard. Every time somebody used the project, you would encode their username and save it in a cloud var. Then an external program would have an account follow that user. Then, you could check that accounts messages to see if it says “Username” favorited project, and send that back in a cloud var.
This is probably the only valid method.

Gaza101: retired member of the Scratch 2.0 Transition Team


wizzwizz7
Scratcher
500+ posts

Love and Favourite Detector in Projects

Gaza101 wrote:

scratchyone wrote:

You could, but it would be hard. Every time somebody used the project, you would encode their username and save it in a cloud var. Then an external program would have an account follow that user. Then, you could check that accounts messages to see if it says “Username” favorited project, and send that back in a cloud var.
This is probably the only valid method.
I think you could do it my way, since, as I said, Scratch is coded in JSON which is basically JavaScript. Besides, the
 (username) 
block works with JavaScript to find the user's username, I think.



Gaza101
Scratcher
500+ posts

Love and Favourite Detector in Projects

wizzwizz7 wrote:

Gaza101 wrote:

scratchyone wrote:

You could, but it would be hard. Every time somebody used the project, you would encode their username and save it in a cloud var. Then an external program would have an account follow that user. Then, you could check that accounts messages to see if it says “Username” favorited project, and send that back in a cloud var.
This is probably the only valid method.
I think you could do it my way, since, as I said, Scratch is coded in JSON which is basically JavaScript. Besides, the
 (username) 
block works with JavaScript to find the user's username, I think.
I wouldn't say JSON is “basically JavaScript.” Anyway, I thought you wanted to get the username of the user who loved/favourited the project.

Gaza101: retired member of the Scratch 2.0 Transition Team


scratchisthebest
Scratcher
1000+ posts

Love and Favourite Detector in Projects

wizzwizz7 wrote:

Scratch is coded in JSON which is basically JavaScript.
Wat

JSON is a data structure?

I am a Lava Expert
wizzwizz7
Scratcher
500+ posts

Love and Favourite Detector in Projects

I could be wrong in saying that

wizzwizz7 wrote:

Scratch is coded in JSON which is basically JavaScript.
- that was what I thought. Sorry…



Firedrake969
Scratcher
1000+ posts

Love and Favourite Detector in Projects

It's basically a JS object, so you're not far off

(JSON == JavaScript Object Notation)

'17 rickoid

bf97b44a7fbd33db070f6ade2b7dc549
wizzwizz7
Scratcher
500+ posts

Love and Favourite Detector in Projects

I didn't exactly mean that Scratch was coded in JSON. But the coding part is JSON - save an sb2 file as a zip file and open the JSON part. That was what I was talking about.



Dylan5797
Scratcher
1000+ posts

Love and Favourite Detector in Projects

wizzwizz7 wrote:

I didn't exactly mean that Scratch was coded in JSON. But the coding part is JSON - save an sb2 file as a zip file and open the JSON part. That was what I was talking about.
The JSON parser doesn't evaluate code, it'll just complain and break the editor.







im so ocd about ip addresses


can you guess what my user icon is

new record


dylan beswick · writing · github · soundcloud

I enjoy coding, writing electronic music, building computers and servers, and playing the piano. I am a big fan of F-777's music, you should really check it out.

I have written a few semi-common pieces of code that are used in scratch projects, like scratchapi.

I'm kind of lonely, I'd like a bit of attention, if that's possible.












i maxed out geoguessr at 25,000 points – https://geoguessr.com/results/GiXQHzXVQSEeWiYT
i truly feel sorry for everybody else in my country
MegaApuTurkUltra
Scratcher
1000+ posts

Love and Favourite Detector in Projects

https://scratch.mit.edu/messages/ajax/user-activity/?user=wizzwizz7&max=100 anyone?

You don't need to be following the user

$(".box-head")[0].textContent = "committing AT crimes since $whenever"
Jonathan50
Scratcher
1000+ posts

Love and Favourite Detector in Projects

Dylan5797 wrote:

wizzwizz7 wrote:

I didn't exactly mean that Scratch was coded in JSON. But the coding part is JSON - save an sb2 file as a zip file and open the JSON part. That was what I was talking about.
The JSON parser doesn't evaluate code, it'll just complain and break the editor.
^^
Jonathan50
Scratcher
1000+ posts

Love and Favourite Detector in Projects

MegaApuTurkUltra wrote:

https://scratch.mit.edu/messages/ajax/user-activity/?user=wizzwizz7&max=100 anyone?

You don't need to be following the user
Good idea.
So, on the Scratch side:
define has (user) loved this project?
encode (username) :: custom
set [☁ username v] to (encoded)
change [☁ get has loved v] by (1)
wait until <(☁ got has loved) = (☁ get has loved)>
set [has loved? v] to (☁ has loved)
And on the backend (psuedocode):
while(true) {
  while(cloud["☁ got has loved"] == cloud["☁ get has loved"]);
  username = decode(cloud["☁ username"]);
  activity = http_request("https://scratch.mit.edu/messages/ajax/user-activity/?user=" + username + "&max=10000");
  if activity.strip()
             .contains("loved <a href=\"/projects/" + project_id + "/\">".strip()) {
    cloud["☁ has loved"] = 1;
  }
  cloud["☁ got has loved"] += 1;
}
QuillzToxic
Scratcher
1000+ posts

Love and Favourite Detector in Projects

I don't think I want this. “You can only acsess this level if you follow!” “The only way to play is if you favourite!”
Gaza101
Scratcher
500+ posts

Love and Favourite Detector in Projects

QuillzToxic wrote:

I don't think I want this. “You can only acsess this level if you follow!” “The only way to play is if you favourite!”
Good point. This could so be abused.

Gaza101: retired member of the Scratch 2.0 Transition Team


Powered by DjangoBB

Standard | Mobile