Calculate JustMySocks Flow

Auto calculate JustMySocks flow info to a simple format

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

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Calculate JustMySocks Flow
// @namespace   superszy
// @author      superszy
// @version     1.0
// @description Auto calculate JustMySocks flow info to a simple format
// @match       https://justmysocks5.net/members/getbwcounter.php*
// @license     MIT
// ==/UserScript==

(function() {
    'use strict';

    let jsonStr = document.querySelector("body").innerText;
    let json = JSON.parse(jsonStr);

    json.monthly_bw_limit_g = json.monthly_bw_limit_b/1000/1000/1000;
    json.bw_counter_g = json.bw_counter_b/1000/1000/1000;
    json.radio = json.bw_counter_b / json.monthly_bw_limit_b;

    document.querySelector("body").innerText += '\n\n流量限制:' + json.monthly_bw_limit_g + ' GB\n已用流量:' + json.bw_counter_g + ' GB\n已用比例:' + json.radio*100 + ' %\n刷新日期:' + json.bw_reset_day_of_month;
})();