Instagram Threads Checker (OSINT)

Check if an instagram username has a threads profile by scraping

目前為 2025-02-19 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Instagram Threads Checker (OSINT)
// @version      1.2
// @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 popup = document.createElement('div');
                popup.style.cssText = `
                   position: fixed;
                   top: 5px;
                   right: 43%;
                   background-color: black;
                   border: 1px solid #ccc;
                   padding: 5px;
                   padding-right: 18px;
                   border-radius: 5px;
                   z-index: 9999;
                   font-weight: bold;
                   `;

                // Create close button
                const closeButton = document.createElement('span');
                closeButton.innerHTML = '×'; // "x" character
                closeButton.style.cssText = `
                   position: absolute;
                   top: 5px;
                   right: 5px;
                   cursor: pointer;
                   color: white;
                   padding-left: 5px;
                   `;
                closeButton.onclick = function() {
                    if (popup) {
                        popup.remove();
                        popup = null;
                        labelAdded = false;
                    }
                };
                popup.appendChild(closeButton);

                const link = document.createElement('a');
                link.target = "_blank";

                if (response.status === 200 && response.responseText.includes('<meta property="og:type" content="profile" />')) {

                    link.href = threadsURL;
                    link.innerText = "Threads Profile: Found"
                    link.style.color = 'Chartreuse';

                } else {

                    link.style.color = 'red';
                    link.innerText = `Threads Profile: Not Found`;
                }

                popup.appendChild(link);
                document.body.appendChild(popup);
            }
        });
    }

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