Reddit-Upvoter

Upvote all links/comments on the page

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Reddit-Upvoter
// @namespace   reddit.upvoter.tool
// @description Upvote all links/comments on the page
// @include     *www.reddit.com*
// @version     1
// @grant       none
// ==/UserScript==

//Generate button
var header = document.querySelectorAll('#header .tabmenu')[0];
if(header) {

  var listItem = document.createElement('li');
  var clickImg = '<img style="height: 15px;" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAZoSURBVHja7JpNbFxXFcd/5943zzN1LIfifLSJE0PqgGMXoUpVSQEBisQGiQWobIqoQIIdSEhISCiIBSuEBGt2oKQ1G6QKkaoqsEhj1ChFaVJoE0gaxzhxbMfxzHg+39c9LN7MZEriaGY8jh2JK81mxu/e87/nd8/HfRZV5VEehkd8PPICPIDk/CnUOTSsgUj6iypksth9nwCxEFRJ5i6COvBzmP0TIAaCKu76RVCABLJD4GfRanHcXXn7Z8Qh5sDUa+bA5Cu4BC3dQTDgEmRkFBkZTZfL30LzC2A9COtoWAdrMR8dhagOImhQRetlMBazcy/26WOpgP740qCVIu7aeezkl6BeeSI5f+pFV6/gZ/yiHHrmlfi90xDUsB9/BsJkGyEkkn5sBi3eJvn3WV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2vQQndzK3BTKFHEIuaG93uOjJ83oEfD8NgHGIn62QZIrIUYxVjb9wHYoAhob7OdKduJzyOAwrnTnrgC3eO0L8dlXv4sxTqvFEVwiW4bNujh56Mr8sej0iRMEVZGxp0/Zw0enPQBdXTgSnX/tRdA0jfvZ/mXZfia7wuL+6O3r36ReJZMZyAPTrTAqzcOgDoJqV7cRZLK9tHWQhG19cadPCXeNbSBkDk792X/hp99B0K523suoLs89FZ15+Th0V8drVMf75Gdft5/+8u+Jgu7c7RJh6PF/tATI8O6rdvy5q11xL4Kqw+XeGWfGHKfLO1ZJYmTPx856k1/8XVpwaVdru7WVtijkEjSodr6DYmjU8GitNNTT1YgIxNGAKy4jYmAg17kIkVbr2UNT3zC+sEi32Nz3HIig9XIKbjcieuuJm8YvQZL0L0M3RNANBV0L+JDxUf/LCxG0XoGg1tXcpmtsknjzSuqWJzoXYbYMmz7hZLYUmz7gZLYcmw3iZLYFNhvAyWwbbHrEyVsfm4Rt0Q+0eaKV7O7rge2CTUc4mf/xgAjEIa7YxGabvn1t4CTNW+ymAE1itLi0NdGmV0+0C0BdeivXKzaqXRdhjb/vndPGel6L/56mknRLjAXtsjJN34/ZjTokbWiyg73fGDy2c8nsPfSb1iumTkdYz8jwrjPSUzvatoX//2+VLR7/HQCbLDSJ3IOE+wAAAABJRU5ErkJggg==" alt="Mass Upvote" />';
  
  var clicker = document.createElement('a');
  clicker.onclick = function() {
    var items = document.querySelectorAll('div.content .sitetable .arrow.up');
    Array.prototype.forEach.call(items, function(el, i){
      setTimeout(function(){
        el.click();
      },100 + ( i * 400 ));
    });
    return false;
  };
  
  clicker.setAttribute('style','background: transparent; cursor: pointer;');
  clicker.setAttribute('title','Mass Upvote');
  clicker.innerHTML = clickImg;
  listItem.appendChild(clicker);

  header.appendChild(listItem);
}