Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @match http://vk.com/*
- // @match https://vk.com/*
- // ==/UserScript==
- // вписываем id группы через которую будем постить
- GROUP_ID = 71855479;
- function initPM() {
- localStorage['pm_group_id'] = arguments[0];
- var xhr = new XMLHttpRequest;
- xhr.open('GET', '/club' + localStorage['pm_group_id']);
- xhr.onload = function () {
- var m = xhr.responseText.match(/"post_hash":"([^"]+)/);
- localStorage['pm_post_hash'] = m[1];
- }
- xhr.send();
- }
- // Message=1&act=post&al=1&facebook_export=&fixed=&friends_only=&from=&hash=f8078a2b50a072150b&official=&signed=&status_export=&to_id=-71855479&type=all
- /*
- ajax.post('/al_wall.php', {
- al: 1,
- act: 'post',
- type: 'all',
- hash: localStorage['pm_post_hash'],
- to_id: -localStorage['pm_group_id'],
- Message: 'секс'
- }, {
- onDone: function (xhr, data) {
- var m = data.match(/<div id="post([^"]+)/);
- console.log('wall' + m[1]);
- }
- });
- */
- function exec(func, args) {
- scr = document.createElement('script');
- scr.innerHTML = '(' + func + ')(' + (args || '') + ')';
- document.head.appendChild(scr);
- }
- // во фреймах не загружаем
- if (top == this) {
- var loc;
- setInterval(function () {
- var cur = location.pathname + location.search;
- if (loc != cur) {
- loc = cur;
- console.log('Адрес изменился: ' + loc);
- if (location.pathname == '/im' && location.search.indexOf('sel=') > -1) {
- console.log('update form');
- }
- }
- }, 10);
- exec(initPM, GROUP_ID);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement