podcastのタイムラインのリンクに変える
code:script.js
class Exporter{
constructor(){
this.outputs = [];
}
addLine(line){
this.outputs.push(line);
}
get(){
return this.outputs.join("\n");
}
}
scrapbox.PopupMenu.addButton({
title: 'timeline',
onClick: text => {
var exporter = new Exporter();
var lines = text.split('\n');
if (lines.length === 0){
return;
}
var count = lines.length;
exporter.addLine(lines0); var url = lines0.trim() + '#t='; for (var i = 1; i < count; i++){
var pattern = /(\d{2}:\d{2})/g
var time = linesi.match(pattern); var u = url + time;
exporter.addLine(" + [u, linesi.join(' ') + "]"); }
return exporter.get();
}
})