Reddit Vote and Comment Fuzzer

Fuzzes vote count, comment count, time posted, and subreddit name for a specific subreddit (on your front page)

目前为 2015-09-18 提交的版本。查看 最新版本

// ==UserScript==
// @name         Reddit Vote and Comment Fuzzer
// @namespace    http://kmcdeals.com
// @version      1
// @description  Fuzzes vote count, comment count, time posted, and subreddit name for a specific subreddit (on your front page)
// @author       Kmc - [email protected]
// @match        *://*.reddit.com/
// @match        *://*.reddit.com/r/all/
// @grant        none
// ==/UserScript==

//configurables - all numbers are random
//for subsList, separate subreddits with ; (eg. "videos;unexpected;wtf")
var subsList = "videos",
    
    subToReplace = "unexpectedjihad",
    
    maxScore = 3700,
    minScore = 1700,

    maxCommentNum = 2500,
    minCommentNum = 700,

    maxTime = 15,
    minTime = 4;


//in case of an error, here are the default values
/*
var subsList = "videos",
    
    subToReplace = "unexpectedjihad",
    
    maxScore = 3700,
    minScore = 1700,

    maxCommentNum = 2500,
    minCommentNum = 700,

    maxTime = 15,
    minTime = 4;
*/


//everything below this line can be ignored

fuzzScores();
function fuzzScores() {
    if(!subsList || !maxScore || !minScore || !maxCommentNum || !minCommentNum || !maxTime || !minTime) return console.log("One of the configurables is null! Please double check that they are correct!");
    
	var subElement = document.querySelectorAll('.link .entry .tagline .subreddit');
	
	for (i = 0; i < subElement.length; i++) {
		var subHref = subElement[i].href;
		
		if (subHref.indexOf(subToReplace) > -1 && subElement[i].className.indexOf('fuzzed') < 0) {
            subElement[i].className += " fuzzed";
			
			var randScore = Math.floor(Math.random() * (maxScore - minScore) + minScore) - 1;
			var randCommentNum = Math.floor(Math.random() * (maxCommentNum - minCommentNum) + minCommentNum);
			var randTime = Math.floor(Math.random() * (maxTime - minTime) + minTime);
			
			var scoreElement = subElement[i].parentElement.parentElement.parentElement.querySelectorAll('.midcol .score');
			var commentElement = subElement[i].parentElement.parentElement.parentElement.querySelector('.buttons .first .comments');
			var timeElement = subElement[i].parentElement.parentElement.parentElement.querySelector('.entry .tagline .live-timestamp');
			

			var subsArr = subsList.split(";");
			var randSub = subsArr[Math.floor(Math.random() * subsArr.length)];

			
            
			if (subElement[i].innerHTML != null && randSub != null) {
				subElement[i].innerHTML = "/r/" + randSub;
			}
			
			if (scoreElement != null) {
				for (v = 0; v < scoreElement.length; v++) {
					scoreElement[v].innerHTML = randScore;
					randScore++;
				}
			}

			if (commentElement != null) {
				commentElement.innerHTML = randCommentNum + " comments";
			}
			
			if (timeElement != null) {
				timeElement.outerHTML = '<time class="live-timestamp">' + randTime + ' hours ago</time>';
			}
		}
	}
}


var mutationObvserver = window.WebKitMutationObserver || window.MutationObserver;
//called everytime the dom changes
var observer = new mutationObvserver(function(mutations) {
    for (i = 0; i < mutations.length; i++) {
    	//this seemed to be the best way to check if RES loaded a new page
    	if (mutations[i].target.id.match(/([A-Za-z-])+/g) == "page-") {
            fuzzScores();
    	}
    }
});

observer.observe(document, {subtree: true, attributes: true});

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址