Created
December 16, 2016 05:50
-
-
Save prail/22bc4759f9d7284bd31e76a857b8c91b to your computer and use it in GitHub Desktop.
A userscript that archives projects you love into your own studio.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Love Archiver | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @description Archives projects you love into a specific studio. | |
// @author @TheUltimatum | |
// @match https://scratch.mit.edu/projects/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
document.body.onload=function main() { | |
var STUDIO="YOUR STUDIO HERE!!!!!"; | |
var heart=document.getElementById("love-this").children[1]; | |
heart.onclick=function() { | |
if (heart.className.toString() == "love icon") { | |
$.ajax({type: "PUT",url: "https://scratch.mit.edu/site-api/projects/in/"+STUDIO+"/add/?pks="+document.location.pathname.split("/")[2]}); | |
location.reload(); | |
} | |
}; | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome use of the Scratch API