Love Archiver

Archives projects you love into a specific studio.

当前为 2016-12-16 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Love Archiver
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  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. location.reload();
  20. }
  21. };
  22. };
  23. })();