Duclv

Auto-likeFB

Mar 16th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         Auto-Like
  3. // @namespace    duclvz
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       duclvz
  7. // @match        https://www.facebook.com/profile.php?id=*
  8. // @match        https://www.facebook.com/*
  9. // @match        https://m.facebook.com/*
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.     'use strict';
  15.     window.onload=function(){
  16.         if (document.querySelector('button.likeButton')) {
  17.             document.querySelector('button.likeButton').click();
  18.         }
  19.         if (Array.from(document.querySelectorAll('a.touchable')).find(function(x){return x.innerHTML === 'Like'})) {
  20.           Array.from(document.querySelectorAll('a.touchable')).find(function(x){return x.innerHTML === 'Like'}).click();
  21.         }
  22.         if (document.querySelector('td a span')) {
  23.           document.querySelector('td a span').parentElement.click();
  24.         }
  25.         if (Array.from(document.querySelectorAll('a')).find(function(x){return x.innerHTML === 'Like'})) {
  26.           Array.from(document.querySelectorAll('a')).find(function(x){return x.innerHTML === 'Like'}).click();
  27.         }
  28.         if (Array.from(document.querySelectorAll('a')).find(function(x){return x.innerHTML === '<b>Like</b>'})) {
  29.           window.close();
  30.         }
  31.       setTimeout(function(){window.close();},3000)
  32.     };
  33. })();
Advertisement
Add Comment
Please, Sign In to add comment