theforumhelpers / theforumhelpers.github.io

The site for the Scratch group "The Forum Helpers"
https://theforumhelpers.github.io/
MIT License
26 stars 16 forks source link

Update To New Studio #280

Open Accio1 opened 3 years ago

Accio1 commented 3 years ago

Is your feature request related to a problem? The Forum Helpers has moved to a new studio, meaning that this site needs to be updated to reflect that! I have made a checklist below of what needs to be changed and features related to this that should be added. Feel free to discuss these features or request new ones!

@leahcimto @gosoccerboy5

LankyBox01 commented 3 years ago

I've got an idea. Why, instead of manually updating the members list, don't we just use a GET request to https://api.scratch.mit.edu/studios/30136012/curators?

LankyBox01 commented 3 years ago

Run this:

let obj;

fetch('https://api.scratch.mit.edu/studios/30136012/curators')
  .then(response => response.json())
  .then(data => obj = data)

and then run this:

for (x in obj) {   
  console.log(obj[x].username);  
}
CST1229 commented 3 years ago

That only gets the first 20 members since it's paginated.

LankyBox01 commented 3 years ago

oh well, what if we do a run on both?

CST1229 commented 3 years ago

Both what? Managers and curators?

LankyBox01 commented 3 years ago

pages :)

CST1229 commented 3 years ago

And also we can GET from the API multiple times, with increasing ?offsets (increasing by 20) repeating until the response is [].

CST1229 commented 3 years ago

Then for each response we store them in an array and iterate through each item of each response to add the members.

LankyBox01 commented 3 years ago

ok all needed is now to get assigned

Accio1 commented 3 years ago

I've got an idea. Why, instead of manually updating the members list, don't we just use a GET request to https://api.scratch.mit.edu/studios/30136012/curators?

  1. Making API requests to Scratch requires a CORS Proxy.
  2. I don't want to spam Scratch's servers by making multiple requests each time someone loads the page.
gosoccerboy5 commented 3 years ago

Run this:

let obj;

fetch('https://api.scratch.mit.edu/studios/30136012/curators')
  .then(response => response.json())
  .then(data => obj = data)

sigh. that would be blocked because they're not the same url

LankyBox01 commented 3 years ago

oh

jeffalo commented 3 years ago

Making API requests to Scratch requires a CORS Proxy. I don't want to spam Scratch's servers by making multiple requests each time someone loads the page.

how about a github actions workflow to automatically create the curator list?

FunctionalMetatable commented 3 years ago

how about a github actions workflow to automatically create the curator list?

pretty easy thing to do, i could do this if you guys allowed me to

leahcimto commented 3 years ago

The site should also be updated accordingly with the new thumbnail.

leahcimto commented 2 years ago

@Accio1 this is a main priority right now, correct?