queen-raae / gatsby-remark-oembed

A GatsbyJS Plugin that transforms oembed links into its corresponding embed code.
https://gatsby-remark-oembed.netlify.com/
MIT License
162 stars 25 forks source link

Add Instagram hack to get around access token requirement? #128

Open raae opened 3 years ago

raae commented 3 years ago

Should we create a hack for Instagram that skips using their oEmbed endpoint?

It would consist of getting the post's id using the schema from the provider list, and then just fill in the html that would have been returned by the oEmbed endpoint.

To activate one should add "hack": true or something to the Instagram options.

nickytonline commented 3 years ago

hack, sounds like a hack.😄

For the Instagram options, if there is no access token present, we can skip the oEmbed endpoint with perhaps a warning that no token was provided or some kind of message like that.

This way, it doesn't cause any friction for folks currently using the embed and if they provide a token, then that's good too.

Another idea could be an option called useAccessToken and the default value is set to true so to opt out, they need to explicitly set it to false.

nickytonline commented 3 years ago

Also, now I know why my embeds for IG aren't working. 😄

raae commented 3 years ago

The solution I have so far in #132 is that it skips fetching if there is no access token, and prints an error to the console. But it does not stop the build.

The PL needs a look and if you like it then it can be merged and closed.

raae commented 3 years ago

I agree a hack will just bloat the plugin, there is now a problem with Twitch oEmbeds as well.

mayanksharma1133 commented 2 years ago

how to hack Instagram id link

raae commented 2 years ago

See settings per provider in the readme.

Not totally sure if this still works as my token has expired...