MySpace View All Friends+

By mrk Last update Feb 25, 2006 — Installed 13,583 times. Daily Installs: 3, 1, 1, 3, 2, 3, 4, 2, 0, 3, 0, 1, 5, 4, 2, 2, 2, 0, 0, 2, 2, 1, 0, 0, 2, 5, 1, 3, 0, 2, 0, 3
// MySpace View All Friends+ v1.0
// by mrk (bbzmark{at}gmail)
//
// ==UserScript==
// @name         MySpace View All Friends+
// @namespace    http://bbzspace.com/
// @description  Extra features for the "View All Friends" page.
// @include      http://home.myspace.com/*
// ==/UserScript==

var pattern = "//div[@id=\"friendsDisplay\"]//div[@class=\"friend\"]//a[1]";
var resultLinks = document.evaluate( pattern, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
var i=0;
while ((res = resultLinks.snapshotItem(i) ) !=null ){

	var friendID = res.href.split("friendid=");

	var addCmt = "http://comments.myspace.com/index.cfm?fuseaction=user&circuitaction=viewProfile_commentForm&friendID="+friendID[1];
	var viewPics = "http://viewmorepics.myspace.com/index.cfm?fuseaction=user.viewPicture&friendID="+friendID[1];
	var msgUsr = "http://mail.myspace.com/index.cfm?fuseaction=mail.message&friendID="+friendID[1];


	var pattern_c = "//div[@id=\"friendsDisplay\"]//div[@class=\"friend\"]//div[@id=\"indicator\"]//span";
	var resultCell = document.evaluate( pattern_c, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );
	var thisCell = resultCell.snapshotItem(i);

	   newMsgUsr = document.createElement('a');
	   newMsgUsr.href = msgUsr;
	   thisCell.parentNode.appendChild(newMsgUsr);
	   newMsgUsr.innerHTML = 'Message';
	   
	   breakOne = document.createElement('br');
	   thisCell.parentNode.appendChild(breakOne);

	   newAddCmt = document.createElement('a');
	   newAddCmt.href = addCmt;
	   thisCell.parentNode.appendChild(newAddCmt);
	   newAddCmt.innerHTML = 'Comment';
	   
	   breakTwo = document.createElement('br');
	   thisCell.parentNode.appendChild(breakTwo);

	   newViewPics = document.createElement('a');
	   newViewPics.href = viewPics;
	   thisCell.parentNode.appendChild(newViewPics);
	   newViewPics.innerHTML = 'View Pics';

	i++;
}