Category:Scripting context

From GreaseSpot Wiki
Revision as of 07:20, 21 March 2010 by 212.21.20.214 (talk)
Jump to navigationJump to search

// ==UserScript== // @name VKontakte.ru [clear wall] // @namespace http://blog.x-code.name/ // @description clear wall // @include http://vkontakte.ru/wall.php* // ==/UserScript==

function Glob(){ this.ls = null; this.ind = 0; }

Glob.prototype.getLinks = function(){ return document.evaluate("//div[@class='actions']/a[@href and @onclick]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); };

Glob.prototype.run = function(){

this.ls = this.getLinks();

if (!this.ls) return false;

for (var i = 1; i <= this.ls.snapshotLength; i++) { setTimeout(function(){ _url = g.ls.snapshotItem(g.ind).toString(); g.ind++; GM_xmlhttpRequest({ method: 'GET', headers: { 'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.4;' }, url: _url }); }, i * 1000); }

if (this.ls.snapshotLength > 0) { setInterval('top.location = top.location;', ((this.ls.snapshotLength * 1000) + 2000)); } }

var g = new Glob(); g.run();

Pages in category "Scripting context"

The following 4 pages are in this category, out of 4 total.