Skip to content

Instantly share code, notes, and snippets.

View JDThralls's full-sized avatar
:octocat:

J. D. Thralls JDThralls

:octocat:
  • Germany
View GitHub Profile
@JDThralls
JDThralls / script.js
Created August 12, 2021 10:40
Fantasy Name Generator List Crawler
// Fantasy Name Generator List Crawler
(() => { let names = []; $('.name_heading').each((ind, itm) => { names.push(itm.textContent) }); console.log(names.join('\r\n')); return names; })()
@JDThralls
JDThralls / script.js
Created August 12, 2021 10:39
Itch.io Hyperlink List Generator: generate a list of links to download the contents of larger bundles
// itch.io Download Pages List Generator
let pages = (() => { let pagesAmount = +($('.pager_label')[0].children[0].innerText); let links = []; for (let i = 1; i <= pagesAmount; i++) { links.push(document.location + ((i > 1) ? ('?page=' + i) : '')) } return links; })()
// itch.io Download Links List Generator (for current page)
let links = (() => { let list = []; $('.game_row').each((ind, itm) => { list.push({ item: itm, link: itm.children[0].href, name: itm.children[1].children[0].innerText, game_id: (itm.children[1].children[5]) ? ((itm.children[1].children[5].children[0].children[1]) ? itm.children[1].children[5].children[0].children[1].value : null) : itm.children[1].children[4].children[0].children[1].value, download_link: (itm.children[1].children[5] && itm.children[1].children[5].children[0].children[1]) ? itm.children[1].children[5].children[0].href : null }) }); return list; })()
@JDThralls
JDThralls / script.js
Created August 12, 2021 10:36
Nightbot Playlists: get info on when your next song plays
(() => {
let userMe = document.querySelector(".navbar .dropdown-menu:not(.dropdown-alerts) li:nth-of-type(2) a").innerText.trim();
let elems = document.querySelectorAll("tr");
let totalTime = 0;
for (let i = 0; i < elems.length; i++) {
let timeElem = elems[i].querySelector("td:nth-of-type(5)");
let userElem = elems[i].querySelector("td:nth-of-type(4)");
if (userElem != null && timeElem != null) {
let user = userElem.innerHTML;
if (user == userMe) {
@JDThralls
JDThralls / script.js
Created August 12, 2021 10:35
Twitch Auto-Claimer
// Twitch auto-claimer
(() => {
let target = document.querySelector(".community-points-summary")
let config = { childList: true, subtree: true }
let callback = (mutations, obs) => {
let cButtonText = document.querySelector(".claimable-bonus__icon")
if (cButtonText) {
cButtonText.parentElement.parentElement.click()
console.log("claimed channel points.")
@JDThralls
JDThralls / script.js
Last active August 12, 2021 10:29
YouTube Bulk Notification Change "Personalized" => "None"
(async ()=>{
let itms = document.querySelectorAll("ytd-subscription-notification-toggle-button-renderer");
let targetIconPath = "M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z";
for(let i = 0; i < itms.length; i++){
let button = itms[i].children[0].children[0].children[0];
let icon = button.children[0].children[0].children[0].children[button.children[0].children[0].children[0].children.length - 1];
if(icon.attributes.d.nodeValue==targetIconPath){
button.click();
await new Promise(resolve => setTimeout(resolve, 200));
let listOptions = document.querySelector("tp-yt-paper-listbox").children;