Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Organized Into 4 Files | I plan on combining these into one file soon. (Very Easy)
- -- Like Everything
- -- Unlike Everything
- -- Like Comments
- -- Unlike Comments
- // Like Everything
- var sad = document.getElementsByTagName('button'), happy = [], halt = false;
- for (var i = 0; i < sad.length; i++) {
- if (sad[i] && hasClass(sad[i], 'like_link')) {
- var sad_likebutton = sad[i].getElementsByTagName('span');
- for (var j = 0; j < sad_likebutton.length; j++) {
- if (sad_likebutton[j] && hasClass(sad_likebutton[j], 'default_message') && sad_likebutton[j].style.display != 'none') happy.push(sad[i]);
- }
- }
- }
- function hasClass(ele, cls) {
- return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
- }
- var happyDiv = document.createElement('div');
- happyDiv.innerHTML = '<div id=\'happy\' style=\'cursor:pointer;background-color:#ddd;font-size:16px;text-align:center;position:fixed;top:40px;right:40px;width:200px;height:100px;border:4px solid black;z-index:9999;padding-top:15px;\' title="Close" onClick="this.parentNode.removeChild(this)"><span>0</span> of ' + happy.length + ' items liked.<div id=\'happyStatus\' style=\'margin-top:30px;\'><a id=\'happyButton\' href=\'#\' style=\'display:block;\' onclick=\'haltFn();\'>Stop it.</a></div></div>';
- document.getElementsByTagName('body')[0].appendChild(happyDiv);
- function happyFn(happy) {
- if (halt || !happy || !happy.length) {
- document.getElementById('happyStatus').innerHTML = 'Done!';
- return;
- }
- happy[0].click();
- happy[0].style.color = '#f00';
- var countSpan = document.querySelector('#happy span');
- countSpan.innerHTML = parseInt(countSpan.innerHTML) + 1;
- window.setTimeout(function () {
- happyFn(happy.splice(1));
- }, 800);
- }
- function haltFn() {
- halt = true;
- return false;
- }
- happyFn(happy);
- // Unlike Everything
- var sad = document.getElementsByTagName('button'), happy = [], halt = false;
- for (var i = 0; i < sad.length; i++) {
- if (sad[i] && hasClass(sad[i], 'like_link')) {
- var sad_likebutton = sad[i].getElementsByTagName('span');
- for (var j = 0; j < sad_likebutton.length; j++) {
- if (sad_likebutton[j] && hasClass(sad_likebutton[j], 'default_message') && sad_likebutton[j].style.display != 'none' && sad_likebutton[0].innerHTML == 'Unlike') happy.push(sad[i]);
- }
- }
- }
- function hasClass(ele, cls) {
- return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
- }
- var happyDiv = document.createElement('div');
- happyDiv.innerHTML = '<div id=\'happy\' style=\'cursor:pointer;background-color:#ddd;font-size:16px;text-align:center;position:fixed;top:40px;right:40px;width:200px;height:100px;border:4px solid black;z-index:9999;padding-top:15px;\' title="Close" onClick="this.parentNode.removeChild(this)"><span>0</span> of ' + happy.length + ' items unliked.<div id=\'happyStatus\' style=\'margin-top:30px;\'><a id=\'happyButton\' href=\'#\' style=\'display:block;\' onclick=\'haltFn();\'>Stop it.</a></div></div>';
- document.getElementsByTagName('body')[0].appendChild(happyDiv);
- function happyFn(happy) {
- if (halt || !happy || !happy.length) {
- document.getElementById('happyStatus').innerHTML = 'Done!';
- return;
- }
- happy[0].click();
- happy[0].style.color = '#f00';
- var countSpan = document.querySelector('#happy span');
- countSpan.innerHTML = parseInt(countSpan.innerHTML) + 1;
- window.setTimeout(function () {
- happyFn(happy.splice(1));
- }, 800);
- }
- function haltFn() {
- halt = true;
- return false;
- }
- happyFn(happy);
- // Like Comments
- var sad = document.getElementsByTagName('button'), happy = [], halt = false;
- for (var i = 0; i < sad.length; i++) {
- if (sad[i] && hasClass(sad[i], 'cmnt_like_link')) {
- var sad_likebutton = sad[i].getElementsByTagName('span');
- for (var j = 0; j < sad_likebutton.length; j++) {
- if (sad_likebutton[j] && hasClass(sad_likebutton[j], 'default_message') && sad_likebutton[j].style.display != 'none') happy.push(sad[i]);
- }
- }
- }
- function hasClass(ele, cls) {
- return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
- }
- var happyDiv = document.createElement('div');
- happyDiv.innerHTML = '<div id=\'happy\' style=\'cursor:pointer;background-color:#ddd;font-size:16px;text-align:center;position:fixed;top:40px;right:40px;width:200px;height:100px;border:4px solid black;z-index:9999;padding-top:15px;\' title="Close" onClick="this.parentNode.removeChild(this)"><span>0</span> of ' + happy.length + ' comments liked.<div id=\'happyStatus\' style=\'margin-top:30px;\'><a id=\'happyButton\' href=\'#\' style=\'display:block;\' onclick=\'haltFn();\'>Stop it.</a></div></div>';
- document.getElementsByTagName('body')[0].appendChild(happyDiv);
- function happyFn(happy) {
- if (halt || !happy || !happy.length) {
- document.getElementById('happyStatus').innerHTML = 'Done!';
- return;
- }
- happy[0].click();
- happy[0].style.color = '#f00';
- var countSpan = document.querySelector('#happy span');
- countSpan.innerHTML = parseInt(countSpan.innerHTML) + 1;
- window.setTimeout(function () {
- happyFn(happy.splice(1));
- }, 800);
- }
- function haltFn() {
- halt = true;
- return false;
- }
- happyFn(happy);
- // Unlike Comments
- var sad = document.getElementsByTagName('button'), happy = [], halt = false;
- for (var i = 0; i < sad.length; i++) {
- if (sad[i] && hasClass(sad[i], 'cmnt_like_link')) {
- var sad_likebutton = sad[i].getElementsByTagName('span');
- for (var j = 0; j < sad_likebutton.length; j++) {
- if (sad_likebutton[j] && hasClass(sad_likebutton[j], 'default_message') && sad_likebutton[j].style.display != 'none' && sad_likebutton[0].innerHTML == 'Unlike') happy.push(sad[i]);
- }
- }
- }
- function hasClass(ele, cls) {
- return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
- }
- var happyDiv = document.createElement('div');
- happyDiv.innerHTML = '<div id=\'happy\' style=\'cursor:pointer;background-color:#ddd;font-size:16px;text-align:center;position:fixed;top:40px;right:40px;width:200px;height:100px;border:4px solid black;z-index:9999;padding-top:15px;\' title="Close" onClick="this.parentNode.removeChild(this)"><span>0</span> of ' + happy.length + ' comments unliked.<div id=\'happyStatus\' style=\'margin-top:30px;\'><a id=\'happyButton\' href=\'#\' style=\'display:block;\' onclick=\'haltFn();\'>Stop it.</a></div></div>';
- document.getElementsByTagName('body')[0].appendChild(happyDiv);
- function happyFn(happy) {
- if (halt || !happy || !happy.length) {
- document.getElementById('happyStatus').innerHTML = 'Done!';
- return;
- }
- happy[0].click();
- happy[0].style.color = '#f00';
- var countSpan = document.querySelector('#happy span');
- countSpan.innerHTML = parseInt(countSpan.innerHTML) + 1;
- window.setTimeout(function () {
- happyFn(happy.splice(1));
- }, 800);
- }
- function haltFn() {
- halt = true;
- return false;
- }
- happyFn(happy);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement