FB People Redirect

By Martin Stone Last update May 21, 2008 — Installed 19,632 times. Daily Installs: 58, 48, 48, 47, 52, 61, 61, 46, 44, 66, 67, 56, 47, 75, 59, 80, 50, 59, 58, 56, 57, 53, 41, 51, 44, 57, 56, 54, 37, 53, 35, 61
// ==UserScript==

// @name           FB People Redirect

// @namespace      Martin Stone

// @description    Redirects to real profiles from the Facebook "people" page when logged in

// @include        http://*.facebook.com/people/*

// ==/UserScript==

location.href = "http://" + startofurl(location.href) + "profile.php?id=" + endofurl(location.href);


function endofurl(inputString) {
   var temp = inputString;
   while (temp.indexOf("/") != -1) {
   	temp = temp.substring(temp.indexOf("/")+1, temp.length);
   }
   return temp;
}

function startofurl(inputString) {
   var temp = inputString.substring(7, inputString.length);
   temp = temp.substring(0, temp.indexOf("/")+1);
   return temp;
}