Skip to content

Instantly share code, notes, and snippets.

@shizone
Created August 3, 2023 00:35
Show Gist options
  • Save shizone/c4128d91f13d8179697ac9c5a858f359 to your computer and use it in GitHub Desktop.
Save shizone/c4128d91f13d8179697ac9c5a858f359 to your computer and use it in GitHub Desktop.
Yukizuriのチャット内容をダウンロードするスクリプト
const times = $.makeArray($('.chat-box-timestamp')).map((e) => e.innerText);
const names = $.makeArray($('.chat-box-name')).map((e) => e.innerText);
const texts = $.makeArray($('.chat-box-text')).map((e) => e.innerText);
const messages = names.map((n, i) => `${times[i]} - ${n}: ${texts[i]}`);
const blob = new Blob([ messages.join('\n')], {'type': 'text/plain'});
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.setAttribute('href', url);
a.setAttribute('download', `yukizuri_${new Date().toLocaleDateString('sv-SE')}.log`);
a.click();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment