Created
September 22, 2011 18:20
-
-
Save FiXato/1235561 to your computer and use it in GitHub Desktop.
Proof of Concept UserJS script to add nicknames to Google+
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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