Search code examples
javascriptlinkedin-api

Fastest way to load many LinkedIN profile widgets


For a member overview I've resorted to loading all their LinkedIN profiles using the LinkedIN Member Profile Plugin. I've once loaded the required javascript:

<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>

After which I'm looping through the members, generically loading their profiles:

<script type="IN/MemberProfile" 
    data-id="<?php echo $linkedin; ?>" 
    data-format="inline" data-related="false"></script>

Where $linkedin is a string to their profile.

This works, but is tediously slow, due to there being around 40 members. Is there a way to cache the result, or make this work faster?


Solution

  • This works, but is tediously slow, due to there being around 40 members. Is there a way to cache the result, or make this work faster?

    No, not really. Those plugins load in an iframe, so you have no JS access to the content.

    But those plugins are not really meant to be used in multitudes on a single page either. If you want “faster”, then you will have to go via their API and get the member details/profile pictures that way, so that you can store them into your system and then serve them from there.