Friends page social categories

By balcy Last update Sep 1, 2009 — Installed 477 times.

There are 9 previous versions of this script.

// ==UserScript==
// @name Friends page social categories
// @description Categories like "Housemates", "Travelbuddies", are now hidden by facebook, but can still be viewn with this script. Just Go to a page of a friend's friends. (It is not possible for your own friends page, but you will appear in their lists)
// @namespace  http://userscripts.org/scripts/show/34067
// @author  http://userscripts.org/users/67181
// @include  http://*.facebook.com/friends/?id=*
// @version 1.4
// ==/UserScript==

var thisurl = document.location.href.toLowerCase();
var socialtype = 0;

var subsec = document.getElementById('friends_page_subtitle');
var newdiv = subsec.parentNode.parentNode.appendChild(document.createElement("div"));

for (var i = 1; i < 5000; i*=2) {
   newanchor = document.createElement("a");
  sometext = document.createTextNode(category(i));
 newanchor.appendChild(sometext);
    newdiv.appendChild(newanchor);
 if (i < 3000) {
sometext2 = document.createTextNode(', ');
newdiv.appendChild(sometext2);
}
newanchor.id = i;
newanchor.addEventListener('click', function (event){
for (var i = 1; i < 5000; i*=2) {document.getElementById(i).style.background = "#eceff5";}
document.getElementById(event.target.id).style.background = "#fcd822";
setTimeout("Friends.filterSocialType("+event.target.id+")", 100);}, 'false');
}

newdiv.style.width = '550px';
newdiv.style.background = '#eceff5';
newdiv.style.padding = '2px';


if (thisurl.indexOf ('view=social', 0) > 0) {

if (thisurl.indexOf (    'st=1', 0) > 0) socialtype = 1;    //Housemates
if (thisurl.indexOf (    'st=2', 0) > 0) socialtype = 2;    //Coworkers
if (thisurl.indexOf (    'st=4', 0) > 0) socialtype = 4;    //Team/Club
if (thisurl.indexOf (    'st=8', 0) > 0) socialtype = 8;    //Coursemates
if (thisurl.indexOf (   'st=16', 0) > 0) socialtype = 16;   //Program
if (thisurl.indexOf (   'st=32', 0) > 0) socialtype = 32;   //Classmates
if (thisurl.indexOf (   'st=64', 0) > 0) socialtype = 64;   //Travel
if (thisurl.indexOf (  'st=128', 0) > 0) socialtype = 128;  //Family
if (thisurl.indexOf (  'st=256', 0) > 0) socialtype = 256;  //Met through friends
if (thisurl.indexOf (  'st=512', 0) > 0) socialtype = 512;  //Met through facebook
if (thisurl.indexOf ( 'st=1024', 0) > 0) socialtype = 1024; //Met randomly
if (thisurl.indexOf ( 'st=2048', 0) > 0) socialtype = 2048; //Relationships
if (thisurl.indexOf ( 'st=4096', 0) > 0) socialtype = 4096; //Dates
}

if (socialtype > 0) {
setTimeout("Friends.filterSocialType("+socialtype+")", 1100);
document.getElementById(socialtype).style.background = "#fcd822";
}

else if (thisurl.indexOf ('view=everyone', 0) > 0)
   setTimeout("Friends.refreshView('everyone')", 1100);

function category (n) {
if (n == 1) return ('Housemates');
if (n == 2) return ('Coworkers');
if (n == 4) return('Team/Club');
if (n == 8) return('Coursemates');
if (n == 16) return('Program');
if (n == 32) return('Classmates');
if (n == 64) return('Travel');
if (n == 128) return('Family');
if (n == 256) return('Met through friends');
if (n== 512)return('Met through facebook');
if (n == 1024)return('Met randomly');
if (n == 2048)return('Relationships');
if (n == 4096)return('Dates');
else return ('');
}