-
-
Save devxan/a30240e8dda196f5c74c3bb999d2e141 to your computer and use it in GitHub Desktop.
Simple userscript for commenting nice when you love a project.
This file contains hidden or 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 magicFluffyUnicorn | |
// @namespace http://tampermonkey.net/ | |
// @version 1.2 | |
// @description Does cool magic fluffy unicorn kind of stuff. | |
// @author @TheUltimatum, @bob1171 | |
// @match https://scratch.mit.edu/projects/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
$(document).ready(function() { | |
$("#love-this").on("click", function() { | |
if ($(this).data("add") === true) { | |
$.ajax({ | |
type: "POST", | |
url: "/site-api/comments/project/" + $(location).attr("href").split("/")[4] + "/add/", | |
data: JSON.stringify({ content: "nice!", parent_id: "", commentee_id: "" }), | |
success: function() { location.reload(); } | |
}); | |
} | |
}); | |
}); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment