Last active
March 16, 2024 06:28
-
-
Save m77so/4ffa454f95cee13a3fe20da21c02414c to your computer and use it in GitHub Desktop.
PC版ミクチャで配信開始時刻を表示する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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