[Hadzy] Youtube Comment Analytics

Hadzy - The best youtube comment picker and great tool to search for all comments, open it with 'Activate' menu button

当前为 2019-12-09 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name [Hadzy] Youtube Comment Analytics
  3. // @namespace https://greasyfork.org/en/users/10118-drhouse
  4. // @version 1.0
  5. // @description Hadzy - The best youtube comment picker and great tool to search for all comments, open it with 'Activate' menu button
  6. // @include https://www.youtube.com/watch?*
  7. // @include https://hadzy.com/analytics/youtube/
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  9. // @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
  10. // @grant GM_getValue
  11. // @grant GM_setValue
  12. // @grant GM_registerMenuCommand
  13. // @author drhouse
  14. // @icon https://www.google.com/s2/favicons?domain=youtube.com
  15. // ==/UserScript==
  16. this.$ = this.jQuery = jQuery.noConflict(true);
  17.  
  18. (function($){
  19.  
  20. GM_registerMenuCommand("Activate", function(){
  21. if (location !== "https://hadzy.com/analytics/youtube/"){
  22. var here = window.location.href;
  23. GM_setValue("ytube", here);
  24. window.location.href = 'https://hadzy.com/analytics/youtube/';
  25. }
  26. }, "A");
  27.  
  28.  
  29. if (window.location.href === 'https://hadzy.com/analytics/youtube/'){
  30. var storedObject = GM_getValue("ytube");
  31. var target1 = $('body > div.page-wrapper > div > div > form > div > input');
  32. var target2 = $('.btn__search');
  33. var target3 = $('.btn__start');
  34. var target4 = $('#body > div.page-wrapper > div > div > div.modal-wrapper.modal--is-visible > div.modal.modal__video > section > div > div.btn-wrapper > button');
  35. $(target1).val(storedObject);
  36. $(target2).click();
  37.  
  38. setTimeout(function(){
  39. $(target3).click();
  40. }, 1000);
  41. }
  42.  
  43. })(jQuery);