Last active
May 13, 2021 03:46
-
-
Save jrw254/5a9709264f9d207f302cf33c32ab18b4 to your computer and use it in GitHub Desktop.
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 Talking Kitties | |
| // @namespace http://tampermonkey.net/ | |
| // @version 0.1.1 | |
| // @description Social Cat's HotKey's | |
| // @author JRW254/SabeDth | |
| // @match https://admin.api.rhombusads.com/hit/* | |
| // @icon https://www.google.com/s2/favicons?domain=rhombusads.com | |
| // @grant none | |
| // ==/UserScript== | |
| /* | |
| The array starts at 0 [I Don't Know] and ends at 27 [Travel]. | |
| 21 seems to be the max amount of subcategories. (Business & Industrial). | |
| Tilde, The Number Row and Backspace = 0-13 on the array. | |
| Key's Z,X,C,V,B,N,M, Comma and, Dot are currently custom key set ups. | |
| Use as templete to create your own custom keys. | |
| */ | |
| let firstCategory = document.getElementsByClassName("list-group-item list-group-item-action"); | |
| for (let i = 0, len = firstCategory.length; i < len; i++) { | |
| } | |
| // Main[...] | |
| window.focus(); | |
| window.addEventListener("keydown", function(event) { | |
| event.preventDefault(); | |
| // Spacebar to submit | |
| if (event.keyCode === 32) { | |
| document.getElementById("submit-button").click(); | |
| } | |
| // Alt to go back | |
| if (event.keyCode === 18) { | |
| document.getElementById("back-button").click(); | |
| } | |
| // A "Post Didn't Load" | |
| if (event.keyCode === 65) { | |
| document.getElementById("reload-button").click(); | |
| } | |
| // Categories[...] | |
| if (event.keyCode === 90) { // Key 90 = z | |
| event.preventDefault(); | |
| firstCategory[2].click(); // Arts & Entertainment = [2] | |
| firstCategory[0].click(); // Celebrities & Entertainment News = [0] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 88) { // Key 88 = x | |
| event.preventDefault(); | |
| firstCategory[2].click(); // Arts & Entertainment = [2] | |
| firstCategory[8].click(); // Offbeat = [8] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 67) { // Key 67 = c | |
| event.preventDefault(); | |
| firstCategory[2].click(); // Arts & Entertainment = [2] | |
| firstCategory[5].click(); // Humor = [5] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 86) { // Key 86 = v | |
| event.preventDefault(); | |
| firstCategory[9].click(); // Food = [9] | |
| firstCategory[0].click(); // Beverages = [0] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 66) { // Key 66 = b | |
| event.preventDefault(); | |
| firstCategory[9].click(); // Food = [9] | |
| firstCategory[2].click(); // Food(sub) = [2] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 78) { // Key 78 = n | |
| event.preventDefault(); | |
| firstCategory[26].click(); // Sports [26] | |
| firstCategory[10].click(); // Team Sports [10] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 77) { // Key 77 = m | |
| event.preventDefault(); | |
| firstCategory[19].click(); // People & Society = [19] | |
| firstCategory[0].click(); // Family & Relationships = [0] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 188) { // Key 188 = , | |
| event.preventDefault(); | |
| firstCategory[19].click(); // People & Society = [19] | |
| firstCategory[1].click(); // Kids = [1] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| if (event.keyCode == 190) { // Key 190 = . | |
| event.preventDefault(); | |
| firstCategory[25].click(); // Shopping = [25] | |
| firstCategory[1].click(); // Apparel = [1] | |
| //document.getElementById("submit-button").click(); // Auto Submit | |
| } | |
| // Keys 1-9[...] | |
| if (event.keyCode === 192) { // Key 48 = `(Tilde) | |
| event.preventDefault(); | |
| firstCategory[0].click(); | |
| } | |
| if (event.keyCode === 49) { // Key 49 = 1 | |
| event.preventDefault(); | |
| firstCategory[1].click(); | |
| } | |
| if (event.keyCode === 50) { // Key 50 = 2 | |
| event.preventDefault(); | |
| firstCategory[2].click(); | |
| } | |
| if (event.keyCode === 51) { // Key 51 = 3 | |
| event.preventDefault(); | |
| firstCategory[3].click(); | |
| } | |
| if (event.keyCode === 52) { // Key 52 = 4 | |
| event.preventDefault(); | |
| firstCategory[4].click(); | |
| } | |
| if (event.keyCode === 53) { // Key 53 = 5 | |
| event.preventDefault(); | |
| firstCategory[5].click(); | |
| } | |
| if (event.keyCode === 54) { // Key 54 = 6 | |
| event.preventDefault(); | |
| firstCategory[6].click(); | |
| } | |
| if (event.keyCode === 55) { // Key 55 = 7 | |
| event.preventDefault(); | |
| firstCategory[7].click(); | |
| } | |
| if (event.keyCode === 56) { // Key 56 = 8 | |
| event.preventDefault(); | |
| firstCategory[8].click(); | |
| } | |
| if (event.keyCode === 57) { // Key 57 = 9 | |
| event.preventDefault(); | |
| firstCategory[9].click(); | |
| } | |
| if (event.keyCode === 48) { // Key 48 = 0 | |
| event.preventDefault(); | |
| firstCategory[10].click(); | |
| } | |
| if (event.keyCode === 189) { // Key 189 = - | |
| event.preventDefault(); | |
| firstCategory[11].click(); | |
| } | |
| if (event.keyCode === 187) { // Key 49 = Equal | |
| event.preventDefault(); | |
| firstCategory[12].click(); | |
| } | |
| if (event.keyCode === 8) { // Key 8 = Backspace | |
| event.preventDefault(); | |
| firstCategory[13].click(); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment