This file contains hidden or 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
(() => { | |
ws = new WebSocket("wss://streaming.qiitadon.com:4000/api/v1/streaming/?stream=public:local"); | |
ws.addEventListener("message", (ev) => { | |
const { event, payload } = JSON.parse(ev.data); | |
if (event === "update") { | |
const status = JSON.parse(payload); | |
speechSynthesis.cancel(); | |
speechSynthesis.speak(new SpeechSynthesisUtterance(status.account.display_name || status.account.username)); | |
speechSynthesis.speak(new SpeechSynthesisUtterance(status.content.replace(/<\/?[^>]+(>|$)/g, ""))); | |
} |
This file contains hidden or 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
#!/usr/bin/osascript -l JavaScript | |
ObjC.import("stdlib"); | |
ObjC.import("AppKit"); | |
ObjC.import("PDFKit"); | |
ObjC.import("Vision"); | |
const scriptName = $.NSProcessInfo.processInfo.arguments.objectAtIndex(3).lastPathComponent.js; | |
console.error = (obj) => { |