Holmes on Ptt

Add info links on Ptt

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Holmes on Ptt
// @namespace   https://github.com/gslin/ptt-holmes
// @match       https://www.ptt.cc/bbs/*
// @grant       none
// @version     0.20250424.0
// @author      Gea-Suan Lin <[email protected]>
// @description Add info links on Ptt
// @license     MIT
// ==/UserScript==

(() => {
  'use strict';

  // User information
  document.querySelectorAll('.push-userid').forEach(el => {
    const userid = el.innerText.trim();

    const el_userid = document.createElement('a');
    el_userid.setAttribute('href', 'https://www.plytic.com/authors/' + userid.toLowerCase());
    el_userid.setAttribute('style', 'color: #ff6;');
    el_userid.innerText = userid;
    el.innerText = '';
    el.appendChild(el_userid);
  });

  // IP address information
  document.querySelectorAll('.push-ipdatetime').forEach(el => {
    const ip = el.innerText.trim().split(' ')[0];
    if (!ip.match(/^[.0-9:]+$/)) {
      return;
    }

    const template = [
      ['IntelX', 'https://intelx.io/?s='],
      ['LeakIX', 'https://leakix.net/search?q=ip:'],
      ['Shodan', 'https://shodan.io/host/'],
    ];

    // Reverse order due to float.
    for (const site of template.reverse()) {
      const el_ip = document.createElement('a');
      el_ip.setAttribute('href', site[1] + ip);
      el_ip.setAttribute('style', 'float: right; font-size: 0.75em; margin-left: 0.333em;');
      el_ip.innerText = site[0];
      el.insertAdjacentElement('beforebegin', el_ip);
    }
  });
})();