"Save Pastebins" By ZippySqrl (https://pastebin.com/u/ZippySqrl) URL: https://pastebin.com/QYNyieBn Created on: Friday 14th of February 2020 10:16:48 AM CDT Retrieved on: Saturday 31 of October 2020 04:26:15 PM UTC // ==UserScript== // @name PastebinSaveText // @version 0.1 // @description Grabs the raw contents of pastes listed on the page, then saves them to a txt file. // @updateURL https://pastebin.com/raw/QYNyieBn // @match https://pastebin.com/u/* // @grant none // ==/UserScript== (function() { 'use strict'; var Raws = {}; function loadHTML(url, row, filename, name, delay){ var xhr = new XMLHttpRequest(); xhr.onreadystatechange=function(){ if(xhr.readyState == 4){ //original code was just for counting text: var code = "Name: " + name + "\n\n" + 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; //part that downloads the file: setTimeout(function() { download(code, filename, "txt"); }, delay * 200); } }; xhr.open("GET", url , true); xhr.send(null); } function SavePastes(){ var C = document.getElementsByClassName("maintable")[0]; if (C!==null){ var path = window.location.pathname; var page = path.split("/").pop(); var numrows = C.rows.length; //C.rows[0].cells[C.rows[0].cells.length-1].innerHTML = "words"; var i, row, srccell, link, src, raw, name; for (i=1; i