Skip to content

Instantly share code, notes, and snippets.

@FiXato
Created September 22, 2011 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FiXato/1235561 to your computer and use it in GitHub Desktop.
Save FiXato/1235561 to your computer and use it in GitHub Desktop.
Proof of Concept UserJS script to add nicknames to Google+
// ==UserScript==
// @name G+ Nicks
// @namespace https://plus.google.com/
// @description Proof of concept script to add nicknames to usernames on G+
// @include https://plus.google.com/*
// ==/UserScript==
anchors = document.getElementsByClassName('yn');
function add_nickname(oid, username) {
switch(oid) {
case '112064652966583500522':
nick = 'FiXato';
break;
//Add cases here for each oid / nick combination. The oid is the unique user id for each profile on G+
default:
nick = oid;
}
nick = ' (' + nick + ')';
username += nick;
return username
}
for (var i = anchors.length - 1; i >= 0; i--) {
var user = anchors[i];
new_username = add_nickname(user.attributes['oid'].value, user.innerText);
user.innerText = new_username;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment