Made With pupeteer and cherio.
challenge link (https://www.findcoder.io/challenges)
npm i monu-linkpreview.
import getLinkPreview from 'monu-linkpreview';
getLinkPreview(url).then(res=>log(res)).catch((err)=>console.log(err));
It will Work In Node.
You Need To Use an Api Call
example (Used Express)
app.post('/', async (req, res) => {
try {
await main(req.body.url).then(re=>res.send(re)).catch((er)=>res.send(er)));
} catch (error) {
res.send(`error ${error}`)
}
})
Full Example Code Here (Soon)