How to embed medium post on website

1.2k views Asked by At

so I am trying to embed the latest entrepreneur profiles from Medium@femalefounderssg into a site made on Wix, I tried to use the JSON and jQuery code here: https://codepen.io/jasonm4130/pen/vZYbQx

var tagIndex = item.description.indexOf('<img'); // Find where the img tag starts
var srcIndex = item.description.substring(tagIndex).indexOf('src=') + tagIndex; // Find where the src attribute starts
var srcStart = srcIndex + 5; // Find where the actual image URL starts; 5 for the length of 'src="'
var srcEnd = item.description.substring(srcStart).indexOf('"') + srcStart; // Find where the URL ends
var src = item.description.substring(srcStart, srcEnd); // Extract just the URL
output += '<div class="blog-element"><img class="img-responsive" src="' + src + '" width="360px" height="240px"></div></header>';

The issue I am facing is that since the code renders the first content that it sees, it always renders the logo (as in the image below), the entrepreneur profile photos that I want displayed with the posts are usually contained in the second

output of above code in my implementation

Could anyone please advise as to how the existing code can be modified or what other possible implementations are there? Thanks so much!

0

There are 0 answers