More tags and add paste providers. Also more analysis

This commit is contained in:
dada513 2022-06-07 15:15:00 +02:00
parent 86c545cb45
commit c39ed8e49c
No known key found for this signature in database
GPG key ID: 403448C14FA4B33E
10 changed files with 240 additions and 89 deletions

19
src/logproviders/0x0.ts Normal file
View file

@ -0,0 +1,19 @@
const reg = /https\:\/\/0x0.st\/[^ ]*/;
export async function read0x0(s: string): Promise<null | string> {
const r = s.match(reg);
if (r == null || !r[0]) return null;
const link = r[0];
let log: string;
try {
const f = await fetch(link);
if (f.status != 200) {
throw 'nope';
}
log = await f.text();
} catch (err) {
console.log('Log analyze fail', err);
return null;
}
return log;
}