orkut one click scrap v 3.1

By Ankur Saxena Last update Jan 15, 2008 — Installed 2,776 times.
// ==UserScript==
// @name           orkut one click scrap v 3.1
// @namespace      
// @description    just one click to view your friends scrapbook.
// @include        *orkut*
// @author		   Ankur Saxena
// ==/UserScript==

// changes from version 3.0
// *Corrected the album link so that it points to album list. The older link was no longer working.


// Changes from  version 2.0
//
// * Adds another link for directly going to the Favorite Video page of the user.

// Changes from version 1.0
//
// * Only adds scrapbook and album links to profile hyperlink not one with a profile picture.
// * Add space between the added hyperlinks.

(function() {
var i=document.getElementsByTagName('a');
for (var j=i.length-1; j>1; j--) {
    var linkdata =  i[j].getAttribute("href");
    var linkparts = linkdata.split("?");
    if (linkdata.match("Profile.") == "Profile." ) {
	    var s = i[j].innerHTML;
	    var s1 = s.indexOf('<');
	    if( s1 < 0 ){
        var scrapviewlink = document.createElement("a");
        scrapviewlink.href="http://www.orkut.com/ScrapBook.aspx"+"?"+linkparts[1];
        scrapviewlink.appendChild(document.createTextNode(" [S] "));

        var albumlink = document.createElement("a");
        albumlink.href="http://www.orkut.com/AlbumList.aspx"+"?"+linkparts[1];
        albumlink.appendChild(document.createTextNode(" [A] "));

	var videolink = document.createElement("a");
        videolink.href="http://www.orkut.com/FavoriteVideos.aspx"+"?"+linkparts[1];
        videolink.appendChild(document.createTextNode(" [V] "));

        i[j].parentNode.insertBefore( videolink ,i[j].nextSibling);
	i[j].parentNode.insertBefore( albumlink ,i[j].nextSibling);
        i[j].parentNode.insertBefore( scrapviewlink ,i[j].nextSibling);
    	}
        }
    }

})();