Instafeed.js: Show links from the caption

Created on 2 Jun 2018  路  6Comments  路  Source: stevenschobert/instafeed.js

Hi I have been trying to browse for this issue but unfortunately can't seem to find it. I am trying to show the links from the caption of an instagram post. Can someone help? TIA

Most helpful comment

Hi guys,

If I understand correctly, you want to detect URLs in the image caption, and convert them to links?

If so, you'll need to do a little extra work with javascript make that happen. Doing this for any possible URL is harder than it seems at first glance. There are various packages out there to do a thorough job, for example https://soapbox.github.io/linkifyjs

Check this pen: https://codepen.io/benjamin-hull/pen/qKjXxX for an example of how to use instafeed.js success callback to run through and 'linkify' all the captions before they're inserted into the page.

Hope that helps - let me know how it goes!

All 6 comments

Hi @jpdpueyo - Can you show an example of your code? A CodePen or JSFiddle example would be really helpful. Thanks!

Hi @benjamin-hull! Thanks for the response. Here is my code.

https://codepen.io/jpdpueyo/pen/aKmwYY

What I'm trying to do is to get the link that I have placed in the caption then display it in my website feed.

I have seen some projects like this. I would like to replicate them. Can you help? Thanks!

Dear All,
The same problem I have it, like @jpdpueyo .

I had to read a lot of suggestions but unfortunately no one have the right way
Please @benjamin-hull I appreciate that if you can helping me.

Thanks in Advance
Mustafa

Hi guys,

If I understand correctly, you want to detect URLs in the image caption, and convert them to links?

If so, you'll need to do a little extra work with javascript make that happen. Doing this for any possible URL is harder than it seems at first glance. There are various packages out there to do a thorough job, for example https://soapbox.github.io/linkifyjs

Check this pen: https://codepen.io/benjamin-hull/pen/qKjXxX for an example of how to use instafeed.js success callback to run through and 'linkify' all the captions before they're inserted into the page.

Hope that helps - let me know how it goes!

Dear @benjamin-hull,

Thanks a lot for your time and Effort to help us.
For me I found the solution but now I have another problem with the CSS to make it responsive but I hope I'll find the solution, if not I will write to you if that possible?

wish you a beautiful day.
Mustafa

Hi @benjamin-hull Thank you very much for your assistance. Really appreciate it. More power!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stevenschobert picture stevenschobert  路  8Comments

benjamin-hull picture benjamin-hull  路  9Comments

belham picture belham  路  3Comments

heaversm picture heaversm  路  3Comments

josiahwiebe picture josiahwiebe  路  5Comments