Skip to content

Instantly share code, notes, and snippets.

@x1yl
Last active December 22, 2022 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save x1yl/12156c5487fbd5fe5141f0c142143e0c to your computer and use it in GitHub Desktop.
Save x1yl/12156c5487fbd5fe5141f0c142143e0c to your computer and use it in GitHub Desktop.
sb.ltn.fi userscripts
// ==UserScript==
// @name sb.ltn.fi preset redirect + replace
// @namespace https://github.com/x1yl
// @version 1.0.4
// @description Completely rewrote sb.ltn.fi preset redirect + replace by blabdude. Change filters to your liking below.
// @author Xtyl
// @updateURL https://gist.githubusercontent.com/x1yl/12156c5487fbd5fe5141f0c142143e0c/raw/sbltnfi-preset-replace.user.js
// @downloadURL https://gist.githubusercontent.com/x1yl/12156c5487fbd5fe5141f0c142143e0c/raw/sbltnfi-preset-replace.user.js
// @match https://sb.ltn.fi/video/*
// @match https://sb.ltn.fi/uuid/*
// @match https://sb.ltn.fi/username/*
// @match https://sb.ltn.fi/userid/*
// @icon https://sb.ltn.fi/static/browser/logo.png
// @run-at document-start
// @grant none
// ==/UserScript==
// custom filters for SBB
const sort = "starttime";
const views = 1;
const votes = 0;
// variables used to see if its a video or user
var currentUrl = location.href;
var videowords = ["sort", "views_min", "votes_min"];
var userwords = ["views_min", "votes_min"];
var video = ["video", "uuid", "uuid"];
var user = ["username", "userid"];
// if its a video add on video preset
for (var i = 0; i < videowords.length; i++) {
if (
currentUrl.includes(videowords[i]) == false &&
currentUrl.includes(video[i]) == true
) {
location.replace(
"?votes_min=" + votes + "&views_min=" + views + "&sort=" + sort + ""
);
break;
}
}
// if its a user add on user preset
for (i = 0; i < userwords.length; i++) {
if (
currentUrl.includes(userwords[i]) == false &&
currentUrl.includes(user[i]) == true
) {
location.replace("?votes_min=" + votes + "&views_min=" + views + "");
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment