Restream template button

Adds a template button to restream.io that changes the title of videos

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Restream template button
// @namespace    http://tamermonkey.net
// @version      0.1
// @description  Adds a template button to restream.io that changes the title of videos
// @author       Jacqueb
// @match        https://restream.io/titles
// @grant        none
// ==/UserScript==

var d = new Date();

if(d.getHours() <= 12) {window.realtime = "Morning"} else {window.realtime = "Evening"};
var wd = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];

setInterval(function() {if(document.getElementsByClassName("form-group")[0] != null) {if(document.getElementById("extrabutton") == null) {document.getElementsByClassName("sub-menu-block")[0].innerHTML += "<div style='margin-left: 120px; margin-top: 140px; position: absolute' id='extrabutton' id='mybutton' class='app-title-main__button'><input onclick='window.lol1 = true' type='button' class='button button_type_action' value='Template'></div>"}}},0)
setInterval(function() {document.getElementById("extrabutton").style.top = "180";
document.getElementById("extrabutton").style.left = "120"; if(window.lol1 == true) {makeDate();}},0);

setInterval(function() {if(document.getElementById("extrabutton") != null) {setStyles()}},0);
function setStyles() {
}

function makeDate() {
    document.getElementById("jsAllTitlesInput").value = 'PHPCG ' + (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear() + ' ' + wd[d.getDay()] + ' ' + realtime + ' Service';
    window.lol1 = false;
}