pixiv ID

show pixiv ID in pixiv. pixiv にてユーザー ID を表示する

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name pixiv ID
// @description show pixiv ID in pixiv. pixiv にてユーザー ID を表示する
// @version 1.0
// @include http://www.pixiv.net/*
// @namespace https://greasyfork.org/users/8032
// ==/UserScript==

;(function() {
  "use strict";
  var addUIDNode = function() {
    var KEY_URL = "http://www.pixiv.net/stacc/";
    var NODE_ID = "userjs-user-id-item";
    var src = document.querySelector("a.tab-feed");
    var dst = document.querySelector(".user-relation");
    var uidnode = document.querySelector("#" + NODE_ID);
    if (!uidnode && src && dst) {
      var userID = src.href.slice(KEY_URL.length).match(/[-\w]*/)[0];
      var li = document.createElement("li");
      var a = document.createElement("a");
      li.id = NODE_ID;
      a.textContent = userID;
      a.href = "http://drawr.net/" + userID;
      a.style.display = "inline-block";
      a.style.paddingLeft = "24px";
      a.style.backgroundImage = "url(http://drawr.net/images/icon_top.gif)";
      a.style.backgroundRepeat = "no-repeat";
      li.appendChild(a);
      dst.appendChild(li);
    }
  };
  if (document.readyState === "complete") addUIDNode();
  else addEventListener("DOMContentLoaded", addUIDNode);
  addEventListener("popstate", addUIDNode);
})();