Guest User

Enuresis

a guest
Dec 20th, 2014
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        enuresis
  3. // @namespace   manyamiroque
  4. // @include     http://1chan.ru/news/res/*
  5. // @version     1
  6. // @grant       none
  7. // ==/UserScript==
  8. var url = document.getElementsByClassName('b-blog-entry_b-header') [0].getElementsByTagName('a') [0].getAttribute('href');
  9. var comments = document.getElementsByClassName('b-comment');
  10. var numbers = [
  11. ];
  12. if (document.getElementsByClassName('l-content-wrap') [0].textContent.toLowerCase().indexOf('сосач') > - 1)
  13. {
  14.   numbers.push(document.getElementsByClassName('l-content-wrap') [0].getElementsByClassName('g-disabled js-post-id-link') [0].textContent.trim().slice(1));
  15. }
  16. for (var i = 0; i < comments.length; i++)
  17. {
  18.   if (comments[i].textContent.toLowerCase().indexOf('сосач') > - 1)
  19.   {
  20.     numbers.push(comments[i].getElementsByClassName('js-paste-link') [0].textContent);
  21.   }
  22. }
  23. if (numbers.length > 0)
  24. {
  25.   var comment = document.createElement('div');
  26.   comment.className = 'b-comment';
  27.   comment.id = 'comment_0000000';
  28.   var info = document.createElement('div');
  29.   info.className = 'b-comment_b-info';
  30.   var date = document.createTextNode('\t\t\t\t\t\t\t32 Хуебря @ 25:61, ');
  31.   info.appendChild(date);
  32.   var postnumt = document.createTextNode('№');
  33.   var postnumta = document.createElement('a');
  34.   postnumta.href = '#0000000';
  35.   postnumta.appendChild(postnumt);
  36.   info.appendChild(postnumta);
  37.   var postnum = document.createTextNode('0000000');
  38.   var postnuma = document.createElement('a');
  39.   postnuma.className = 'js-paste-link';
  40.   postnuma.name = '0000000';
  41.   postnuma.href = 'javascript://';
  42.   postnuma.appendChild(postnum);
  43.   info.appendChild(postnuma);
  44.   var image = document.createElement('img');
  45.   image.src = 'http://1chan.ru/ico/remove.gif';
  46.   image.width = '16';
  47.   image.height = '16';
  48.   image.alt = '0000000';
  49.   var ima = document.createElement('a');
  50.   ima.href = '#';
  51.   ima.className = 'js-remove-button g-hidden';
  52.   ima.appendChild(image);
  53.   info.appendChild(ima);
  54.   comment.appendChild(info);
  55.   var body = document.createElement('div');
  56.   body.className = 'b-comment_b-body g-clearfix';
  57.   var text = document.createElement('p');
  58.   for (var i = 0; i < numbers.length; i++)
  59.   {
  60.     var ref = document.createElement('a');
  61.     ref.className = 'js-cross-link';
  62.     ref.name = 'news/' + numbers[i];
  63.     ref.href = url + '#' + numbers[i];
  64.     var reftext = document.createTextNode('>>' + numbers[i]);
  65.     ref.appendChild(reftext);
  66.     text.appendChild(ref);
  67.     var br = document.createElement('br');
  68.     text.appendChild(br);
  69.   }
  70.   if (numbers.length > 1)
  71.   var t = document.createTextNode('\n\t\t\t\t\t\tобоссал пидорнух');
  72.    else
  73.   var t = document.createTextNode('\n\t\t\t\t\t\tобоссал пидорнуху');
  74.   text.appendChild(t);
  75.   body.appendChild(text);
  76.   comment.appendChild(body);
  77.   var child = document.getElementById('template_comment');
  78.   child.parentNode.insertBefore(comment, child);
  79. }
Advertisement
Add Comment
Please, Sign In to add comment