1
2
3
4
5
6
7
8
9
10
11
import { fetch } from "https://esm.town/v/std/fetch";
export let getURLMetadata = async (url) => {
const response = await fetch(url);
const webpage = await response.text();
// Maybe this will work when val.town switches to Deno :-)
// const parser = new DOMParser();
const DOM = parseXML(webpage);
// const DOM = parser.parseFromString(webpage, "text/html");
return DOM;
};
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
October 23, 2023