Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function lalka() {
  2. // Получаем массив элементов
  3. var stickerArray = Array.from( document.querySelectorAll('.sticker') );
  4.  
  5. // Если хотя бы один элемент есть в массиве
  6. if ( stickerArray.length ) {
  7.  
  8. // Проходим циклам по всем элементам, делаем, что нам нужно
  9.   stickerArray.forEach( function (sticker) {
  10.       var stickerTitle = sticker.getAttribute('title');
  11.       var arr = stickerTitle.split('\n').filter(str=>{return str.length > 0})
  12.       let arr2 = ['Team Dignitas (Holo) | Katowice 2014', 'Virtus.Pro (Holo) | Katowice 2014', 'Vox Eminor (Holo) | Katowice 2014', 'Team LDLC.com (Holo) | Katowice 2014', 'Natus Vincere (Holo) | Katowice 2014', 'Clan-Mystik (Holo) | Katowice 2014', 'LGB eSports (Holo) | Katowice 2014', 'Fnatic (Holo) | Katowice 2014', 'Ninjas in Pyjamas (Holo) | Katowice 2014', 'iBUYPOWER | Katowice 2014', 'mousesports (Holo) | Katowice 2014', 'Reason Gaming | Katowice 2014', 'Titan | Katowice 2014', '3DMAX (Holo) | Katowice 2014', 'compLexity Gaming (Holo) | Katowice 2014', 'Vox Eminor | Katowice 2014', 'LGB eSports | Katowice 2014', 'ESL Wolf (Foil) | Katowice 2014', 'Natus Vincere | Katowice 2014', 'Team LDLC.com | Katowice 2014', 'Fnatic | Katowice 2014', 'ESL Skull (Foil) | Katowice 2014', 'Ninjas in Pyjamas | Katowice 2014', 'Virtus.Pro | Katowice 2014', 'compLexity Gaming | Katowice 2014', 'Team Dignitas | Katowice 2014', 'mousesports | Katowice 2014', 'Clan-Mystik | Katowice 2014', 'HellRaisers | Katowice 2014', '3DMAX | Katowice 2014', 'HellRaisers (Holo) | Katowice 2014', 'iBUYPOWER (Holo) | Katowice 2014', 'Reason Gaming (Holo) | Katowice 2014', 'Titan (Holo) | Katowice 2014', 'Howling Dawn', 'kennyS (Gold) | Krakow 2017', 'Crown (Foil)', 'shroud (Gold) | Krakow 2017', 'King on the Field', 'Vox Eminor (Holo) | Katowice 2015', 'Flammable (Foil)'];
  13.       let obj = {};
  14.      
  15.       for (let i = 0; i < arr.length; i += 1) {
  16.           if (arr2.includes(arr[i])) {
  17.               obj[arr[i]] = true;
  18.           }
  19.       }
  20.            if (Object.keys(obj).length){
  21.                var notification = new Notification('Notification title', {
  22.       icon: 'http://cdn.sstatic.net/stackexchange/img/logos/so/so-icon.png',
  23.       body: Object.keys(obj)
  24.     });
  25.                }
  26.          
  27.       //Wear: 0% - Unscratched
  28.        
  29.  
  30.   });
  31.   // Проходим циклам по всем элементам, делаем, что нам нужно
  32.   stickerArray.forEach( function (sticker) {
  33.       var stickerTitle = sticker.getAttribute('title');
  34.       var arr = stickerTitle.split('\n').filter(str=>{return str.length > 0})
  35.       var nnn = arr.find(bbb => -1 != bbb.indexOf('sale'))
  36.            
  37.   });
  38.  
  39. }
  40. }
  41. setTimeout(lalka, 350);
  42.  
  43. setTimeout(function(){
  44.    window.location.reload(1);
  45. }, 5600);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement