Love Archiver

Archives projects you love into a specific studio.

  1. // ==UserScript==
  2. // @name Love Archiver
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Archives projects you love into a specific studio.
  6. // @author @TheUltimatum
  7. // @match https://scratch.mit.edu/projects/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. document.body.onload=function main() {
  14. var STUDIO="YOUR STUDIO NUMBER HERE!";
  15. var heart=document.getElementById("love-this").children[1];
  16. heart.onclick=function() {
  17. if (heart.className.toString() == "love icon") {
  18. $.ajax({type: "PUT",url: "https://scratch.mit.edu/site-api/projects/in/"+STUDIO+"/add/?pks="+document.location.pathname.split("/")[2]});
  19. console.log("Added: https://scratch.mit.edu/projects"+document.location.pathname.split("/")[2]);
  20. }
  21. };
  22. };
  23. })();