NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name AlwaysAskOuija // @namespace http://tampermonkey.net/ // @version 0.1 // @description /r/AskOuija improvements // @author SorryButDownvoted // @match https://www.reddit.com/r/AskOuija* // @grant none // @updateURL https://openuserjs.org/meta/SorryButDownvoted/AlwaysAskOuija.meta.js // @copyright 2018, SorryButDownvoted (https://openuserjs.org/users/SorryButDownvoted) // @license MIT // ==/UserScript== (function() { 'use strict'; window.addEventListener('load', function() { var titles = $('.self').get().map((s) => $(s).find('.title>a').html()); var flairs = $('.self').get().map((s) => $(s).find('.linkflairlabel').html()); var blanks = flairs.map(function (text){ var result = (text || 'unanswered').match(/^Ouija says:(?: ?(.*))$/); if (result) { return result[1]; } }); $('.self .title>a').each(function (i){ if (typeof blanks[i] != 'undefined') { if (blanks[i] === '') { var newself = $(this).html().replace(/_/g, '').replace(/ /g, ' '); } else { var newself = $(this).html().replace(/_{2,}/g, '<u>' + blanks[i] + '</u>'); } $(this).html(newself); } }); }, false); })();