Brick hill posts per day

Tells you (on average) how much a user posts per day

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Brick hill posts per day
// @author       Noah
// @match        https://www.brick-hill.com/forum/thread/*
// @match        https://www.brick-hill.com/user/*
// @description  Tells you (on average) how much a user posts per day
// @version      1.0
// @namespace http://tampermonkey.net/
// ==/UserScript==

let el = document.querySelectorAll("span.light-gray-text")
for(let x = 0; x < el.length; x+=2) {
    let date = el[x].innerText.match(/(\d+)\/(\d+)\/(\d+)/)
    date = new Date(`${date[3]} ${date[2]} ${date[1]}`)
    let days = Math.floor((new Date() - date)/1000/60/60/24)
    let posts = parseInt(el[x+1].innerText.match(/[\d,]+/)[0].replace(/,/g,""))
    let text = document.createElement("span")
    text.className = "light-gray-text"
    text.innerText = (posts/days).toFixed(1) + " posts per day"
    document.querySelectorAll(".col-3-12")[x/2].appendChild(document.createElement("br"))
    document.querySelectorAll(".col-3-12")[x/2].appendChild(text)
}
if(document.querySelectorAll(".stats-table")) {
let date = document.getElementById("join-date").innerText.match(/(\d+)\/(\d+)\/(\d+)/)
date = new Date(`${date[3]} ${date[2]} ${date[1]}`)
let days = Math.floor((new Date() - date)/1000/60/60/24)
let posts = parseInt(document.getElementById("forum-posts").innerText.match(/[\d,]+/)[0].replace(/,/g,""))
let text = document.createElement("td")
    text.innerText = (posts/days).toFixed(1) + " posts per day"
    let tr = document.createElement("tr")
    tr.innerHTML = "<td><b>Posts per day:</b></td>"
    tr.appendChild(text)
    document.querySelectorAll(".stats-table")[0].appendChild(tr)
}