Orkut Scrapbook Deleter

By gultus Last update Sep 15, 2008 — Installed 815 times. Daily Installs: 1, 0, 0, 1, 0, 0, 0, 3, 0, 1, 0, 1, 1, 2, 0, 0, 3, 0, 1, 1, 3, 3, 1, 3, 0, 1, 0, 1, 2, 4, 5, 0

There are 1 previous version of this script.

// ==UserScript==
// @version 1
// @name Orkut Scrapbook Deleter
// @author  http://www.orkut.com/Profile.aspx?uid=15963659674315462805
// @namespace
// @description Deletes all scraps and pauses if u receive a new scrap during of process of deletion
// @include *orkut*Scrapbook.aspx*
// ==/UserScript==

/*************************************************************************************************
Came Across the script http://userscripts.org/scripts/show/8283
I have re written the script to make it more user friendly. The line that deletes the scraps remains the same.
Features Added:
1)Warns any new scrap received during the process of deletion. 
For safety purposes if the internet connection goes slow i have given the time as 5 minutes.
So if there is a scrap int he past five minutes at any point of time of deletion the script pauses and shows an alert box.
2)Adds a delete all scraps button instead of executing the script each time the scrap book is accessed.
**************************************************************************************************/

window.addEventListener(
	'load',
	function() {
if ( window.location.href.match("&gultisgod") == ("&gultisgod") ){
if(document.body.innerHTML.indexOf("no scraps") == -1){
if(document.body.innerHTML.match(/\([0-5] (minutes|minute) ago/) == null || confirm("You have a scrap in the last five minutes\nPress Ok to continue Deletion\nPress Cancel to stop deletion")){
window.location.href = "javascript: _checkAll(document.scrapsForm,'scrapKeys', true); javascript: _singleDelete(function() {_submitForm(scrapsForm, 'delete')});"
}
}
}
else{
var a = document.getElementsByTagName("a");
for(i=0;i<a.length;i++)
if(a[i].innerHTML=="delete selected scraps"){
var deletescrapsbtn = a[i];
break;
}
var button = document.createElement('span');
button.innerHTML="<span class='grabtn'><a class='btn' onclick='if(confirm(\"Do you really want to delete all your scraps?\")){window.location.href=\"http://www.orkut.com/Scrapbook.aspx?&pageSize=30&gultisgod\";}' href='javascript:void(0);'>delete all scraps</a></span><SPAN class=btnboxr><IMG height=1 alt='' src='http://img1.orkut.com/img/b.gif' width=5></SPAN>";
deletescrapsbtn.parentNode.parentNode.insertBefore(button, deletescrapsbtn.parentNode);
}
	},
	true);