Closed ghost closed 7 years ago
Which embed provider are you using?
I am using the code from the following link
https://github.com/VulcanJS/Vulcan/blob/master/packages/vulcan-embedly/lib/components/EmbedlyURL.jsx
I know but which service are you using for providing the embed metadata? If it's just the built-in plugin, I haven't really tested it much so it's possible that it doesn't work perfectly.
I am using builtin
embed provider see the following code:
const embedProvider = getSetting('embedProvider', 'builtin');
I want to change it anyway. For now I would suggest using Embedly or EmbedAPI, or else if you want to submit a PR you could try implementing https://github.com/ianstormtaylor/metascraper ?
I am using the following code
import Embed from '../../modules/embed.js';
import Metascraper from 'metascraper';
Embed.builtin = {
getData(url) {
let metadata = Metascraper.scrapeUrl(url);
// console.log(metadata,'::: metadata')
// const metadata = extractMeta(url);
return {
title: metadata.title,
description: metadata.description,
thumbnailUrl: metadata.image,
}
}
}
But it is getting undefined
{ title: undefined,
description: undefined,
thumbnailUrl: undefined
}
I think you need to use async/await?
How to do this?
See the examples in Metascraper readme
Ok Thanks
The
result
of the following code not giving the proper dataSome times it is not getting the
title
,body
and most of the time it is not getting thethumbnail
Hoe to fix this problem?