Advertisement
Guest User

Untitled

a guest
Jan 27th, 2017
1,002
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. // ==UserScript==
  2. // @name ComboHateScript
  3. // @namespace odnoklassniki
  4. // @description tvoi mama ibalj
  5. // @include http://www.odnoklassniki.ru/online
  6. // @include http://odnoklassniki.ru/online
  7. // @include https://ok.ru/online
  8. // @version 1.0.2017
  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 = "29", // <= 99
  21.  
  22. cityList = [ "Грозный", "Урус-Мартан", "Гудермес", "Хасавюрт", "Дербент", "Махачкала" ],
  23. phraseList = [ "Э гандон, я твою маму ебал",
  24. "Сука, маму твою ебал",
  25. "Ну и пидрила",
  26. "Ну и урод!",
  27. "Ты че, пидор что ли?",
  28. "Фу бля!",
  29. "Хач",
  30. "Я твой рот ебал, пидор дырчатый",
  31. "Твоя мать – шлюха",
  32. "Сломал бы тебе ебало за такие фотографии",
  33. "Вот я тебя и нашёл, пидор",
  34. "Ну чё, когда мне тебе очко сломать?",
  35. "Че за гомик?",
  36. "Гомосек 100%",
  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. setTimeout(fetchPhotos, fetchWaitTime);
  143. }
  144.  
  145. setTimeout(doScript, initialWaitTime);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement