live-testing Discord oEmbed fixes ugh

pull/19/head
tycrek 3 years ago
parent d359fce3b1
commit cbc432cfd8
No known key found for this signature in database
GPG Key ID: 25D74F3943625263

@ -182,7 +182,7 @@ function startup() {
// oEmbed response for clickable authors/providers
// https://oembed.com/
// https://old.reddit.com/r/discordapp/comments/82p8i6/a_basic_tutorial_on_how_to_get_the_most_out_of/
app.get('/:resourceId/oembed', (req, res) => {
app.get('/:resourceId/oembed.json', (req, res) => {
// Parse the resource ID
let resourceId = req.params.resourceId.split('.')[0];
@ -191,7 +191,7 @@ function startup() {
// Build the oEmbed object
let { opengraph } = data[resourceId];
let oembed = {};
let oembed = { version: '1.0' };
opengraph.author && (oembed.author_name = opengraph.author);
opengraph.authorUrl && (oembed.author_url = opengraph.authorUrl);
opengraph.provider && (oembed.provider_name = opengraph.provider);

@ -65,7 +65,7 @@ const html = `
<title>ass</title>
<meta property="og:type" content="{{{ogtype}}}">
<meta property="og:{{{type}}}" content="{{{http}}}{{{domain}}}/{{{resourceId}}}{{{ext}}}">
<link type="application/json+oembed" href="/{{{resourceId}}}/oembed">
<link rel="alternate" type="application/json+oembed" href="/{{{resourceId}}}/oembed.json" title="oEmbed">
{{{title}}}
{{{description}}}
{{{site}}}

Loading…
Cancel
Save