Greasy Fork

来自缓存

Greasy Fork is available in English.

Mastodon Trending posts 辅助脚本

在待审查流行嘟文条目下标注该用户注册时间、嘟文数、正在关注数、关注者数

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name        Mastodon Trending posts 辅助脚本
// @namespace   https://blog.bgme.me/
// @icon        https://bgme.me/favicon.ico
// @match       https://bgme.me/admin/trends/statuses
// @match       https://bgme.bid/admin/trends/statuses
// @grant       GM_xmlhttpRequest
// @version     1.0
// @author      bgme
// @description 在待审查流行嘟文条目下标注该用户注册时间、嘟文数、正在关注数、关注者数
// @inject-into content
// @license     AGPL-3.0-or-later
// ==/UserScript==

Array.from(document.querySelectorAll('.batch-table__row--attention .pending-account__header a.name-tag')).map((a) => {
  const id = a.href.split('/').slice(-1)[0];
  const account__header = a.parentElement.parentElement;

  GM_xmlhttpRequest({
    url: `${document.location.origin}/api/v1/accounts/${id}`,
    responseType: 'json',
    onload: (raw) => {
      const data = raw.response;
      const detail = `${data.created_at.split('T')[0]} • ${data.statuses_count} Posts • ${data.following_count} Following • ${data.followers_count} Followers`;
      account__header.appendChild(document.createElement('br'));
      account__header.appendChild(document.createTextNode(detail));
    }
  })
})