Skip to content

Instantly share code, notes, and snippets.

@m77so
Last active March 16, 2024 06:28
Show Gist options
  • Save m77so/4ffa454f95cee13a3fe20da21c02414c to your computer and use it in GitHub Desktop.
Save m77so/4ffa454f95cee13a3fe20da21c02414c to your computer and use it in GitHub Desktop.
PC版ミクチャで配信開始時刻を表示する
// ==UserScript==
// @name New script mixch.tv
// @namespace Violentmonkey Scripts
// @match https://mixch.tv/u/*/live
// @grant none
// @version 1.0
// @author -
// @description 2024/3/16 15:05:40
// ==/UserScript==
(function() {
'use strict';
var htmlSource = document.documentElement.outerHTML;
const r = /window\.__INITIAL_JS_STATE__\s*=\s*(\{.+?\});\s*/
const p = JSON.parse(htmlSource.match(r)[1])["liveInfo"]
const start = new Date(p["created"] * 1000)
const time_txt = document.createElement("span")
time_txt.innerHTML = " " + start.toLocaleString() + "~"
document.querySelector("div.css-s5xdrg:nth-child(2)").appendChild(time_txt)
console.log(new Date(p["created"] * 1000).toLocaleString())
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment