home tools games

Useful Codes

Add all in list to studio:

    function getCookie(cname) {
      let name = cname + "=";
      let decodedCookie = decodeURIComponent(document.cookie);
      let ca = decodedCookie.split(';');
      for(let i = 0; i <ca.length; i++) {
        let c = ca[i];
        while (c.charAt(0) == ' ') {
          c = c.substring(1);
        }
        if (c.indexOf(name) == 0) {
          return c.substring(name.length, c.length);
        }
      }
      return "";
    }
    
    studio = 31155186;
    curators = []
    
    for(var i = 0;i<100;i++){
    curator = curators[i+100];
    fetch("https://scratch.mit.edu/site-api/users/curators-in/" + studio + "/invite_curator/?usernames=" + curator, {
        "credentials": "include",
        "headers": {
            "User-Agent": "",
            "Accept": "*/*",
            "Accept-Language": "en, en;q=0.8",
            "X-Requested-With": "XMLHttpRequest",
            "X-CSRFToken": getCookie("scratchcsrftoken"),
            "X-KL-Ajax-Request": "Ajax_Request"
        },
        "referrer": "https://scratch.mit.edu/studios/" + studio + "/curators",
        "method": "PUT",
        "mode": "cors"
    });
    }