From 641d2a9427416d2f9271fd9927bc2cabf306c939 Mon Sep 17 00:00:00 2001 From: Nicolas Hamelin Date: Sat, 9 Dec 2023 11:11:02 +1100 Subject: [PATCH] Increment version and update readme --- README.md | 1 + package.json | 4 ++-- server/services/oembed.js | 10 +++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 82e8953..71fb576 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,7 @@ If you paste the url `https://www.youtube.com/watch?v=tkiOqSTVGds` in the modal, - Tiktok - Soundcloud - Spotify +- Twitter Feel free to submit a PR with the provider you want, you just have to edit this file: `server/services/oembed.js`. diff --git a/package.json b/package.json index 58f4d6a..03f2d9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-oembed", - "version": "1.1.0", + "version": "1.2.0", "description": "Embed content from third party sites (YouTube, Vimeo, SoundCloud, Spotify...) in Strapi", "strapi": { "name": "oembed", @@ -35,7 +35,7 @@ "@strapi/strapi": "^4.4.0" }, "engines": { - "node": ">=14.19.1 <=18.x.x", + "node": ">=14.19.1 <=20.x.x", "npm": ">=8.0.0" }, "license": "MIT" diff --git a/server/services/oembed.js b/server/services/oembed.js index f54a250..02a62a2 100644 --- a/server/services/oembed.js +++ b/server/services/oembed.js @@ -36,11 +36,11 @@ module.exports = ( break; case 'twitter.com': - fetchedData = await axios.get(`https://publish.twitter.com/oembed?url=${encodeURIComponent(url)}`).then(res => res.data); - title = fetchedData.author_name; - mime = 'text/twitter'; - thumbnail = null; // Twitter oEmbed may not provide a thumbnail - break; + fetchedData = await axios.get(`https://publish.twitter.com/oembed?url=${encodeURIComponent(url)}`).then(res => res.data); + title = fetchedData.author_name; + mime = 'text/twitter'; + thumbnail = null; // Twitter oEmbed may not provide a thumbnail + break; case 'soundcloud.com': fetchedData = await axios.get(`https://www.soundcloud.com/oembed?url=${encodeURIComponent(url)}&format=json`).then(res => res.data);