Booru Tag Parser

I wrote an addon that extracts the tags on booru posts and Illustration2Vec to your clipboard. Which is very useful if you like tagging your saved images with things like Hydrus Network. It’s in its infancy so it might not support every image booru out there but it pull requests for new CSS selectors are welcome. The script auto-updates so feel free to make github issues with requests for sites that don’t work.

Download and Install

https://github.com/JetBoom/boorutagparser

Screenshots

copytags1

copytags3copytags2

Speaking of which, Illustration2Vec is probably the coolest thing I’ve seen in a while. Give it an image (it works best with vectorizable things like illustrations) and it’ll use machine learning and image parsing algorithms to automatically tag your image. It’s surprisingly accurate too, being able to detect minute details and give the image accurate tags.

And if you don’t know what Hydrus Network is, it’s the second coolest thing I’ve seen in a while. All images can be hashed with sha256, a hash so long that there will likely not be any collisions with any other images. Hydrus lets you attach tags to those hashes so you can have your own personal collection and very easily sort/search through thousands of images and videos based on those tags. The meat though is that it can also subscribe to tag + file servers so you can see the tags that other people have given to them. There’s already millions of image -> tag mappings and it was funny seeing my ancient image macros having content tags on them. There’s a whole bunch of exported tag databases for various image repositories and an already-tag-updated installation at /hydrus/

hydrus

Removing bad games from the SteamDB sale list

EDIT: SteamDB just added a rating and discount filter to their website.

Here’s another Tampermonkey script. Steam sales are a great and often you want to see which games are the most percent off. Steam itself doesn’t have this feature, but SteamDB has a great sales section that lists all the games, how much they are, what percentage they’re off, and what rating they have. You can sort both sites by rating. You can also sort SteamDB by percentage off but unfortunately you cannot filter by minimum rating, resulting in a list of games with crappy ratings to sift through. This script fixes that by completely removing all games with bad ratings. If only Steam itself had this feature for its front page.

Download

As usual, you’ll need Tampermonkey for Chrome or Greasemonkey for Firefox. It’s untested for Greasemonkey. Change the line with min_rating to whatever number you want. I’ve set it to 80%. Anything 79% or less will not show up at all.

// ==UserScript==
// @name SteamDB Bad Game Remover
// @namespace http://average.website
// @version 1.0
// @description Remove games on SteamDB that have less than a certain rating.
// @author William "JetBoom" Moodhe
// @match https://steamdb.info/sales/
// @grant none
// @run-at document-end
// ==/UserScript==
/* jshint -W097 */
'use strict';

//////////////

// What rating does the game need to show up on the list?
var min_rating = 80;

//////////////

var ratings = document.querySelectorAll("table.table-sales td:nth-child(7) > span");
var removed = 0;

var td;
var inner;
var rating;
var i;
for (i=0; i < ratings.length; i++)
{
 td = ratings[i];
 inner = td.innerHTML;
 
 if (inner.substr(-1) == "%")
 {
 rating = Number(inner.substr(0, inner.length - 1));
 if (rating < min_rating)
 {
 td.parentElement.parentElement.style.display = "none";
 removed++;
 }
 }
}

console.log("Removed " + removed + " bad games.");

Removing YouTube recommendations with Tampermonkey

recom

Now you’ve done it. You’ve accidentally clicked a link to click bait, a top 10 list, an annoying Let’s Player, or you’ve dared to see more than two videos on a certain subject matter. You’re cursed to always see thumbnails of garbage videos for the rest of time.

There’s a couple addons floating around that advertise removing all YouTube recommendations. They’re quite bloated though, and some of them didn’t seem to work for me. We’re programmers though, we can fix this. Enter Tampermonkey and mutation observers. It’s easy enough to remove all the parent elements of spans containing the word “Recommend”. YouTube has a load more button though, so a quick fix for that was  the use of mutation observers. These things observe elements, attributes, or the entire page for changes to the DOM and report back to javascript with them. So as new content is added to the list of videos, we can filter those too. The result is a nice, clean front page with only channels that you’ve subscribed to.

recom2

Download

You’ll need Tampermonkey from the web store here.

After you’ve installed that, press the icon in the top right and press Add new script. Paste the following code in and press CTRL+S to save.

// ==UserScript==
// @name Suggest-me-not
// @namespace http://average.website
// @version 1.0
// @description Removes suggestions and recommendations on the YouTube front page for channels you aren't subscribed to.
// @author William "JetBoom" Moodhe
// @match https://www.youtube.com/
// @grant none
// @run-at document-end
// ==/UserScript==
/* jshint -W097 */
//'use strict';

function removeSuggestions()
{
 var spans = document.querySelectorAll("ol.section-list span");

 // Remove ancestor li element of spans that have recommendations.
 var span;
 var par;
 for (var i=0; i < spans.length; i++)
 {
 span = spans[i];

 if (span.innerHTML == "Recommended channel for you" || span.innerHTML == "Recommended" || span.innerHTML == "Want all the latest updates? Subscribe now.")
 {
 par = span.parentElement;
 while (par != null && par.nodeName.toLowerCase() != "li")
 par = par.parentElement;

 if (par != null)
 par.style.display = "none";
 }
 }
}

// Mutation Observer to check for DOM changes to the section list.
var content = document.querySelector("ol.section-list");
if (content)
{
 var observer = new MutationObserver(function(mutations) {
 mutations.forEach(function(mutation) {
 removeSuggestions();
 });
 });
 observer.observe(content, {childList: true, subtree: true});
}

// Immediately remove suggestions once.
removeSuggestions();

Enjoy YouTube without recommendations.