javascript:(()=>{const STUDIO_ID=prompt("スタジオidを教えて。"),csrf=document.cookie.split("; ").find(v=>v.startsWith("scratchcsrftoken="))?.split("=")[1];if(!csrf)return console.error("csrf取れん");document.querySelectorAll(".studio-member-tile").forEach(tile=>{if(tile.querySelector(".invite-btn"))return;const links=tile.querySelectorAll("a");if(links.length<2)return;const username=links[1].textContent.trim();if(!username)return;const btn=document.createElement("button");btn.textContent="招待",btn.className="invite-btn",btn.style.marginLeft="8px",btn.style.cursor="pointer",btn.onclick=()=>{fetch(`https://scratch.mit.edu/site-api/users/curators-in/${STUDIO_ID}/invite_curator/?usernames=${encodeURIComponent(username)}`,{method:"PUT",credentials:"include",headers:{"X-Requested-With":"XMLHttpRequest","X-CSRFToken":csrf}}).then(r=>{if(!r.ok)throw new Error(r.status);btn.textContent="招待済み",btn.disabled=!0}).catch(e=>{console.error("招待失敗",e),alert("招待失敗")})},tile.appendChild(btn)})})();