SHARE
TWEET

Untitled

a guest Mar 20th, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         YouTube AutoLike Video
  3. // @namespace    http://rodrigopcampos.com.br/
  4. // @version      0.1
  5. // @description  Auto like videos on YouTube Channel, if referer is http://nullrefer.com/
  6. // @author       Rodrigo Campos <rodrigo@rodrigopcampos.com.br>
  7. // @match        https://www.youtube.com/watch?v=*
  8. // @match        http://www.youtube.com/watch?v=*
  9. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  10. // @grant        none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14.     'use strict';
  15.     console.info('============= Starting Auto-like Videos (YouTube) by Kyko =============');
  16.     var YT_LIKED_VIDEO = false;
  17.  
  18.     function runScript() {
  19.       if(!YT_LIKED_VIDEO) {
  20.           var oReferrer = document.referrer;
  21.  
  22.           if(oReferrer.indexOf('nullrefer.com') != -1) {
  23.               console.info('== You came from YTMonster, searching like button ...');
  24.               var element = $('ytd-menu-renderer.ytd-video-primary-info-renderer > div > ytd-toggle-button-renderer');
  25.               //console.info(element);
  26.               element.prev().click();
  27.               YT_LIKED_VIDEO = true;
  28.           }
  29.       }
  30.     }
  31.     setInterval(function(){ runScript(); }, 2000);
  32. })();
RAW Paste Data
Top