import { parsedMeta } from "https://deno.land/x/ogp_parser/mod.ts"
const result = parsedMeta("https://example.com")
console.log(result.title) // -> "Example Domain"
If you want to restrict the allowed origins, use the allowOrigins
option.
import { parsedMeta } from "https://deno.land/x/ogp_parser/mod.ts"
const result = parsedMeta("https://example.com", {
allowOrigins: ["https://example.com"],
});
console.log(result.title) // -> "Example Domain"
Since metadata does not change frequently, we recommend caching the retrieved results in Deno KV.