Skip to content

Instantly share code, notes, and snippets.

@BlaM
Created June 19, 2018 11:32
Show Gist options
  • Save BlaM/b511ee18713b293641b80962c68f332a to your computer and use it in GitHub Desktop.
Save BlaM/b511ee18713b293641b80962c68f332a to your computer and use it in GitHub Desktop.
TamperMonkey - show Twitter User-IDs
// ==UserScript==
// @name Twitter UserID
// @namespace http://tampermonkey.net/
// @version 0.1
// @description show Twitter User-IDs
// @author You
// @match https://twitter.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var btn = document.querySelector('.user-actions-follow-button');
if (btn) {
var userId = btn.parentNode.dataset.userId;
var li = btn.parentNode.parentNode.parentNode.previousSibling;
var newLi = document.createElement('LI');
li.parentNode.insertBefore(newLi, li);
newLi.classList = 'ProfileNav-item';
newLi.innerHTML = '<span class="ProfileNav-stat"><span class="ProfileNav-label">UserId</span><span class="ProfileNav-value">' + userId + '</span></span>';
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment