mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-11-14 00:43:50 +00:00
filtering all sources of post images
This commit is contained in:
parent
4d6867e690
commit
f2cb916782
@ -17,6 +17,12 @@ export const GET: RequestHandler = async ({ url }) => {
|
|||||||
// Read data as string
|
// Read data as string
|
||||||
const text = await response.text();
|
const text = await response.text();
|
||||||
|
|
||||||
|
// Get all sources of posts
|
||||||
|
const regex = /<img[^>]+role="presentation"[^>]+src="(.*?)"[^>]*>/g;
|
||||||
|
let results = [], match;
|
||||||
|
while ((match = regex.exec(text)) !== null)
|
||||||
|
results.push(match[1]);
|
||||||
|
|
||||||
// Return source data
|
// Return source data
|
||||||
return json({ success: true, results: text.split('\n') } as APIResponse);
|
return json({ success: true, results } as APIResponse);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user