Instagram ID Viewer

View ID of user instagram

目前為 2018-09-11 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Instagram ID Viewer
// @namespace    http://tampermonkey.net/
// @version      1.16
// @description  View ID of user instagram
// @author       Anonymous
// @match        https://www.instagram.com/*/*
// @grant        none
// ==/UserScript==
document.querySelector('#react-root > section > main > div > header > section > div > h1').innerText += ', ID: '+window._sharedData.entry_data.ProfilePage[0].graphql.user.id;
oldT = document.querySelector('#react-root > section > main > div > header > section > div > h1').innerText;
vc();

function vc(){
   var newT = document.querySelector('#react-root > section > main > div > header > section > div > h1').innerText;
   if(oldT !== newT) {
       document.querySelector('#react-root > section > main > div > header > section > div > h1').innerText += ', ID: '+ getID(location.href);
       oldT = document.querySelector('#react-root > section > main > div > header > section > div > h1').innerText;
       setTimeout(vc,100);
   } else {
       setTimeout(vc,100);
   }
}

function getID(url,callback){
	xhr = new XMLHttpRequest();
	xhr.open('get',url,callback?true:false);
    xhr.send();
	if(callback !== undefined)
  		callback(xhr.responseText.split('"id":')[1].split(',')[0].split('"')[1]);
	else
		return xhr.responseText.split('"id":')[1].split(',')[0].split('"')[1];
}