您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Adds a button to add upcoming hololive streams to Google Calendar
当前为
// ==UserScript== // @name Holotools - Add to Google Calendar // @namespace http://tampermonkey.net/ // @version 0.2 // @description Adds a button to add upcoming hololive streams to Google Calendar // @author You // @match https://hololive.jetri.co/ // @icon https://www.google.com/s2/favicons?domain=jetri.co // @grant none // ==/UserScript== function wait_for_bar(){ if (document.querySelectorAll("body > div > main > div.md-app-scroller.md-layout-column.md-flex.md-theme-holodark.md-scrollbar > div > div > div:nth-child(3) > div") !== null) { var vods = document.querySelectorAll("body > div > main > div.md-app-scroller.md-layout-column.md-flex.md-theme-holodark.md-scrollbar > div > div > div:nth-child(3) > div") var links = [] for (let word of vods) { var title = word.getElementsByClassName("video-title")[0].innerHTML; var time = word.getElementsByClassName("video-start")[0].innerHTML var edate2 = new Date(Date.parse(time)) var now = new Date() edate2.setFullYear(now.getFullYear()) if (now > edate2) { edate2.setFullYear(now.getFullYear()+1) } edate2 = edate2.setHours(edate2.getHours() + 1) var edate1 = new Date(Date.parse(time)) edate1.setFullYear(now.getFullYear()) if (now > edate1) { edate1.setFullYear(now.getFullYear()+1) } var date = edate1.toISOString() var date2 = new Date(edate2).toISOString() var url1 = "https://www.google.com/calendar/render?action=TEMPLATE&text=" var url2 = "&dates=" var space = "/" date = date.replace(/:/g,'').replace(/-/g,'').replace(/\./g,'') date2 = date2.replace(/:/g,'').replace(/-/g,'').replace(/\./g,'') title = encodeURIComponent(title) var final = url1.concat(title,url2,date,space,date2) console.log(final) links.push(final) } for (var i = 0; i < vods.length; i++) { this["marker"+i] = vods[i].appendChild(document.createElement("button")); this["marker"+i].innerHTML = "Add to Calendar" } var createClickHandler = function(arg) { return function() { window.open(arg); }; } for (var e = 0; e < vods.length; e++) { this["marker"+e].onclick = createClickHandler(links[e]) } clearInterval(interval1); } } var interval1 = setInterval(wait_for_bar, 1000)
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址