SwagTv script

this script will automatically fetch and go to the next video after the meter goes up.

目前为 2015-09-01 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name SwagTv script
  3. // @description this script will automatically fetch and go to the next video after the meter goes up.
  4. // @version 0.34
  5. // @include http://video.swagbucks.com/*
  6. // @require http://code.jquery.com/jquery-git.js
  7. // @namespace swagtv
  8. // ==/UserScript==
  9. //
  10. // --------------------------------------------------------------------
  11.  
  12. var iLoops = 0;
  13. window.setInterval(reloadTimer,1000);
  14. var notes = false;
  15.  
  16. var k = getK();
  17.  
  18. $("video-title").remove();
  19. $("commentsCont").remove();
  20.  
  21. var randomNum = 0;
  22.  
  23. function getK(){
  24. $("#video-title").remove();
  25. $("#commentsCont").remove();
  26. var m = $('div.thumb-container.next-item a').attr("href");
  27. if (!m){
  28. if (!$('span.feed-ajax-next').length)
  29. m = null;
  30. else{
  31. $('span.feed-ajax-next').click();
  32. setTimeout(function() { getURL() }, 5000);
  33. }
  34. }
  35. return m
  36. }
  37.  
  38. function getURL(){
  39. var m = $('div.thumb-container:first a').attr("href");
  40. k=m;
  41. }
  42.  
  43. function reloadTimer(){
  44. iLoops++;
  45. if (iLoops%5==0)
  46. console.log(iLoops);
  47. if (iLoops == 5) {
  48. console.log(k);
  49. if ($("#meterDuplicateVideo").is(':visible'))
  50. randomNum = 8;
  51. else
  52. randomNum = Math.floor(Math.random()*15 + 50);
  53. if (k == null)
  54. notes = true;
  55. }
  56.  
  57. if (iLoops == randomNum){
  58. console.log("Match!");
  59. if ($("#sbvd_capText").is(":visible"))
  60. alert('Captcha');
  61. else {
  62. if (notes)
  63. alert("Pick a new category");
  64. else{
  65. link = k;
  66. window.location.href = link;
  67. }
  68. }
  69. }
  70. }