Instagram Threads Checker (OSINT)

Check if an instagram username has a threads profile by scraping

当前为 2025-02-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Instagram Threads Checker (OSINT)
// @version      1.1
// @description  Check if an instagram username has a threads profile by scraping
// @author       SH3LL
// @match        *://www.instagram.com/*
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @namespace https://greasyfork.org/users/762057
// ==/UserScript==

(function() {
    'use strict';

    function checkThreadsAccount(username) {
        console.log(username)
        if (!username) return;
        let threadsURL = `https://www.threads.net/@${username}`;

        GM_xmlhttpRequest({
            method: "GET",
            url: threadsURL,
            onload: function(response) {
                let container = document.querySelector(".x6s0dn4.x78zum5.x1q0g3np.xs83m0k.xeuugli.x1n2onr6");
                if (!container) return;

                let messageBox = document.createElement("div");
                messageBox.style.fontSize = "14px";
                messageBox.style.fontWeight = "bold";
                messageBox.style.marginTop = "5px";
                messageBox.style.padding = "5px 10px";
                messageBox.style.borderRadius = "5px";
                messageBox.style.display = "inline-block";
                messageBox.style.textAlign = "center";

                if (response.status === 200 && response.responseText.includes('<meta property="og:type" content="profile" />')) {
                    messageBox.innerHTML = `<a href="${threadsURL}" target="_blank" style="color:white; text-decoration:none;">Threads Profile</a>`;
                    messageBox.style.backgroundColor = "green";
                } else {
                    messageBox.innerHTML = `No Threads Profile`;
                    messageBox.style.backgroundColor = "red";
                }

                messageBox.style.color = "white";
                container.children[0].appendChild(messageBox);
            },
            onerror: function() {
                console.error("Threads Profile Connection Error");
            }
        });
    }

    setTimeout(() => {
        let username = window.location.href.replace("https://www.instagram.com/","").split("/")[0];
        console.log("IG username: "+username);
        checkThreadsAccount(username);
    }, 3000);
})();