"shitty quick wordcount thingy" By ZippySqrl (https://pastebin.com/u/ZippySqrl) URL: https://pastebin.com/z3Gp8mM3 Created on: Monday 19th of June 2017 07:15:03 PM CDT Retrieved on: Saturday 31 of October 2020 04:26:09 PM UTC // ==UserScript== // @name PastebinDisplayWordCount // @namespace http://zippysqrl.tumblr.com/ // @version 0.1 // @description Grabs the raw contents of pastes listed on the page, counts the words and displays that number in the table. cus zippy is sick and tired of having to load each one just to find out they're short and crappy. // @author ZippySqrl // @updateURL https://pastebin.com/raw/z3Gp8mM3 // @match https://pastebin.com/u/* // @grant none // ==/UserScript== (function() { 'use strict'; var Raws = {}; function loadHTML(url, row){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange=function(){ if(xhr.readyState == 4){ var code = xhr.responseText; var words = code.match(/\b[\w|-]+\b/g).length; var wordcount = words.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); row.cells[row.cells.length-1].innerHTML = wordcount; } }; xhr.open("GET", url , true); xhr.send(null); } var C = document.getElementsByClassName("maintable")[0]; if (C!==null){ var numrows = C.rows.length; C.rows[0].cells[C.rows[0].cells.length-1].innerHTML = "words"; var i, row, srccell, link, src, raw; for (i=1; i