Skip to content

Instantly share code, notes, and snippets.

@ateesdalejr
Created December 16, 2016 05:50
Show Gist options
  • Select an option

  • Save ateesdalejr/22bc4759f9d7284bd31e76a857b8c91b to your computer and use it in GitHub Desktop.

Select an option

Save ateesdalejr/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();
}
};
};
})();
@kickofline
Copy link

yassss

@csf30816
Copy link

Awesome use of the Scratch API

@ateesdalejr
Copy link
Author

@csf30816 Thanks.

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