Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name New Userscript
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match http://vk.com/*
- // @grant none
- // ==/UserScript==
- function addJQuery(callback) {
- var script = document.createElement("script");
- script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js");
- script.addEventListener('load', function() {
- var script = document.createElement("script");
- script.textContent = "(" + callback.toString() + ")();";
- document.body.appendChild(script);
- }, false);
- document.body.appendChild(script);
- }
- lastChange = 0;
- changeW = function() {
- if(new Date()-lastChange < 1000) return;
- lastChange = new Date();
- console.log('changing');
- $('.newbut').each(function(){$(this).remove();});
- $('.post.all.own').each(function() {
- $(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>');
- });
- };
- window.sendPost = function (data) {
- var kudaxt = prompt("Куда будем слать?", "");
- //alert();
- var link = 'http://csgomax.net/resend.php?wallpost='+data+'&kuda='+kudaxt;
- console.log(link);
- $.get(link, function(json) {
- alert(json);
- });
- };
- function main() {
- changeW();
- $('#page_wrap').bind("DOMSubtreeModified",changeW);
- }
- addJQuery(main);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement