Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. // ==UserScript==
  2. // @name New Userscript
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match http://vk.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. function addJQuery(callback) {
  12. var script = document.createElement("script");
  13. script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
  14. script.addEventListener('load', function() {
  15. var script = document.createElement("script");
  16. script.textContent = "(" + callback.toString() + ")();";
  17. document.body.appendChild(script);
  18. }, false);
  19. document.body.appendChild(script);
  20. }
  21.  
  22. lastChange = 0;
  23. changeW = function() {
  24. if(new Date()-lastChange < 1000) return;
  25. lastChange = new Date();
  26. console.log('changing');
  27. $('.newbut').each(function(){$(this).remove();});
  28. $('.post.all.own').each(function() {
  29. $(this).prepend('<button onclick="sendPost(\''+$(this).attr('id')+'\')" class="flat_button button_wide newbut" style="width: 50px; position:absolute; z-index: 100; margin-top: 60px">CP</button>');
  30. });
  31. };
  32.  
  33. window.sendPost = function (data) {
  34. var kudaxt = prompt("Куда будем слать?", "");
  35. //alert();
  36. var link = 'http://csgomax.net/resend.php?wallpost='+data+'&kuda='+kudaxt;
  37. console.log(link);
  38. $.get(link, function(json) {
  39. alert(json);
  40. });
  41. };
  42.  
  43. function main() {
  44. changeW();
  45. $('#page_wrap').bind("DOMSubtreeModified",changeW);
  46. }
  47.  
  48. addJQuery(main);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement