Facebook Wower

This is the poison that is Facebook Wower.

  1. // ==UserScript==
  2. // @name Facebook Wower
  3. // @namespace facebookWow
  4. // @version 0.1
  5. // @description This is the poison that is Facebook Wower.
  6. // @author William Nielsen
  7. // @match http*://www.facebook.com/*
  8. // @run-at document-end
  9. // @grant none
  10. // ==/UserScript==
  11. /* jshint -W097 */
  12. 'use strict';
  13.  
  14. function scanForPosts(){
  15. var likeList = document.querySelectorAll('[data-testid="fb-ufi-likelink"]') ;
  16.  
  17.  
  18. for( var i = 0; i < likeList.length; i++ ){
  19. var a = likeList[i].parentElement.querySelector('[aria-label="Wow"]');
  20. if( a ){
  21. console.log('Wowed a post: ' + i);
  22. a.setAttribute('aria-pressed', 'true');
  23. a.click();
  24. }else{
  25. console.log("a is null");
  26. }
  27.  
  28. }
  29. }
  30.  
  31.  
  32.  
  33. document.addEventListener("keyup", scanForPosts);