Skip to content

Instantly share code, notes, and snippets.

@prail
Created December 16, 2016 05:50
Show Gist options
  • Save prail/22bc4759f9d7284bd31e76a857b8c91b to your computer and use it in GitHub Desktop.
Save prail/22bc4759f9d7284bd31e76a857b8c91b to your computer and use it in GitHub Desktop.
A userscript that archives projects you love into your own studio.
// ==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();
}
};
};
})();
@prail
Copy link
Author

prail commented Sep 24, 2017

@csf30816 Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment