Advertisement
Guest User

Untitled

a guest
Jan 27th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Anticockhole
  3. // @namespace odnoklassniki
  4. // @description SLAVA UKRAINE!
  5. // @include http://www.odnoklassniki.ru/online
  6. // @include http://odnoklassniki.ru/online
  7. // @include https://ok.ru/online
  8. // @version 1.0
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var initialWaitTime = 5000,
  13. reloadWaitTime = 2000,
  14. popupWaitTime = 1000,
  15. photoLoadWaitTime = 2500,
  16. closeWaitTime = 1000,
  17. fetchWaitTime = 3000,
  18.  
  19. minAge = "14", // >= 14
  20. maxAge = "33", // <= 33
  21.  
  22. cityList = [ "Киев", "Луганск", "Донецк", "Харьков", "Одесса", "Днепр" ],
  23. phraseList = [ "Слава Урине!",
  24. "Иди сала наверни",
  25. "Свинья газонюхская",
  26. "Слава богу, что я не родился хохлом",
  27. "Хохлина обоссанная",
  28. "Ненавижу хохлов",
  29. "Почему укринцы такие дауны?",
  30. "Укроп ебаный",
  31. "Сала урине!",
  32. "Почему не на майдане?",
  33. "В котёл тебя, свинья подзаборная",
  34. "Хахол вонючий",
  35. "Свинья",
  36. "Почему бы тебе не пойти нахуй?",
  37. "Назвал бы тебя петухом, если бы ты не был свиньёй",
  38. "Усраина",
  39. "Нюхай газ, казлина",
  40. "Здохни" ];
  41.  
  42. document.getElementsByClass = function(tagName, className) {
  43. var itemsfound = new Array,
  44. elems = document.getElementsByTagName(tagName),
  45. i;
  46. for(i = 0; i < elems.length; ++i) {
  47. if(elems[i].className === className) {
  48. itemsfound.push(elems[i]);
  49. }
  50. }
  51. return itemsfound;
  52. };
  53.  
  54. function processPhoto (photos) {
  55. var evObj;
  56. if (photos.length === 0) {
  57. setTimeout(doScript, reloadWaitTime);
  58. return;
  59. }
  60.  
  61. evObj = document.createEvent('MouseEvents');
  62. evObj.initEvent('mouseover', true, false);
  63. photos[0].children[0].children[0].dispatchEvent(evObj);
  64.  
  65. setTimeout(function () {
  66. var photoLink = document.getElementsByClass("a", "gwt-shortcutMenu-iconlink-item")[0].children[0];
  67. photoLink.click();
  68. }, popupWaitTime);
  69.  
  70. setTimeout(function () {
  71. var commentBlock = document.getElementsByClass("div","itx_w")[0],
  72. commentEditField,
  73. commentButton,
  74. dislikeBlock = document.getElementsByClass("a", "marks-new_ic __val-1")[0],
  75. dislikeButton,
  76. closeButton = document.getElementsByClass("div", "js-photoLayerClose ic photo-layer_close")[0],
  77. usersOnlineButton = document.getElementsByClass("a", "sm fo4c_h_live-link fs-15")[0],
  78. rand = Math.floor((Math.random()*phraseList.length));
  79.  
  80. photos.splice (0,1);
  81.  
  82. if (dislikeBlock) {
  83. dislikeBlock.click();
  84. }
  85.  
  86. if (commentBlock) {
  87. commentEditField = commentBlock.children[0];
  88. commentEditField.focus ();
  89. commentEditField = commentBlock.children[0];
  90. commentEditField.innerHTML = phraseList[rand];
  91. setTimeout (function () {
  92. commentButton = document.getElementsByClass("button", "button-pro form-actions_yes")[0];
  93. if (commentButton) {
  94. commentButton.click();
  95. }
  96. closeButton.click();
  97. setTimeout (function () {
  98. processPhoto (photos);
  99. }, closeWaitTime);
  100. }, popupWaitTime);
  101. } else if (document.getElementById ("addPrivateProfileButton")) {
  102. usersOnlineButton.click();
  103. setTimeout(doScript, reloadWaitTime);
  104. } else {
  105. closeButton.click();
  106. setTimeout (function () {
  107. processPhoto (photos);
  108. }, closeWaitTime);
  109. }
  110. }, photoLoadWaitTime);
  111. }
  112.  
  113. function fetchPhotos () {
  114. var photos = document.getElementsByClass("a", "photoWrapper"),
  115. usersOnlineButton = document.getElementsByClass("a", "sm fo4c_h_live-link fs-15")[0];
  116. if (photos.length === 0) {
  117. usersOnlineButton.click();
  118. setTimeout(doScript, reloadWaitTime);
  119. } else {
  120. processPhoto (photos);
  121. }
  122. }
  123.  
  124. function doScript() {
  125. var photos = document.getElementsByClass("a", "photoWrapper"),
  126. cityLink = document.getElementById ("onSiteNowCityLink"),
  127. cityEditField,
  128. ageSelect = document.getElementsByClass("select", "isl isl__res isl__2num"),
  129. minAgeSelect = ageSelect[0],
  130. maxAgeSelect = ageSelect[1],
  131. rand = Math.floor((Math.random()*cityList.length));
  132.  
  133. minAgeSelect.value = minAge;
  134. maxAgeSelect.value = maxAge;
  135.  
  136. cityLink.click ();
  137. cityEditField = document.getElementById ("field_city");
  138. cityEditField.value = cityList[rand];
  139.  
  140. checkbox = document.getElementById ("field_female");
  141. checkbox.click ();
  142. checkbox.click ();
  143. setTimeout(fetchPhotos, fetchWaitTime);
  144. }
  145.  
  146. setTimeout(doScript, initialWaitTime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement