Advertisement
Guest User

Untitled

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