// ==UserScript== // @name Upboats // @namespace upboats // @version 2015.08.16 // @include *://boards.4chan.org/* // @grant GM_xmlhttpRequest // @description Adds upvote and downvote buttons to 4chan threads // @downloadURL none // ==/UserScript== 'use strict'; function element(tag,parent,attributes,innerhtml){ var newtag=document.createElement(tag) if(attributes){ for(var i in attributes){ newtag.setAttribute(i,attributes[i]) } } if(innerhtml){ newtag.innerHTML=innerhtml } if(parent){ parent.appendChild(newtag) } return newtag } function giveboats(startfrom,query){ var posts=[] for(var i=startfrom||0;i101){ posts.splice(1,posts.length-101) } posts=posts.join(',') GM_xmlhttpRequest({ method:'post', headers:{ 'Content-type':'application/x-www-form-urlencoded' }, url:'http://kek.grn.cc/boat/?r=*&brd='+currentboard, data:'tid='+posts, onload:function(response){ if(response.status==200){ var boatarray=response.responseText.replace(/\n$/,'').split('\n') for(var i=0;i