More tags and add paste providers. Also more analysis
This commit is contained in:
parent
86c545cb45
commit
c39ed8e49c
10 changed files with 240 additions and 89 deletions
19
src/logproviders/0x0.ts
Normal file
19
src/logproviders/0x0.ts
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue