// ==UserScript== // @name AO3 Random Nice Comments // @namespace http://tampermonkey.net/ // @version 1.0 // @license MIT // @description Want to leave more kudos? Leave a random nice comment with the click of a button // @match *://*.archiveofourown.org/* // @grant none // @downloadURL https://update.greasyfork.icu/scripts/450063/AO3%20Random%20Nice%20Comments.user.js // @updateURL https://update.greasyfork.icu/scripts/450063/AO3%20Random%20Nice%20Comments.meta.js // ==/UserScript== let anonName = 'Anon'; let anonEmail = 'askd.noreply@noreply.com'; function niceComment() { let niceComments = [ 'Kudos! ♥', 'I loved this!', 'This was great ♥', '♥ ♥ ♥', '<3 <3 <3', 'This is great ♥', 'Loved this <3', 'Thank you for sharing this ♥', 'Kudos ♥' ] let n = Math.floor(Math.random() * niceComments.length) return niceComments[n] } function getInputsByValue(value) { // kudos button has a universal id but the comment button id is unique to the work var allInputs = document.getElementsByTagName("input"); var results = []; for(var x=0;x