Advertisement
Guest User

Untitled

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