Recently there were some changes in Monarch Plugin to get the follower count from LinkedIn. Monarch plugin only helps to get you the follower from your profile. What to do when you need your company follower count using LinkedIn API in Monarch plugin. I have made few changes. This is monarch plugin_version = ‘1.2.3’:
First we have to change in monarch.php file
case 'linkedin' :
if ( isset( $settings['access_tokens']['linkedin'] ) ) {
$url = sprintf( 'https://api.linkedin.com/v1/people/~:(num-connections)?oauth2_access_token=%1$s&format=json', $settings['access_tokens']['linkedin'] );
}
make some change as below TO get company follower count
case 'linkedin' :
if ( isset( $settings['access_tokens']['linkedin'] ) ) {
$url = sprintf( 'https://api.linkedin.com/v1/companies/{company_id}/num-followers?oauth2_access_token=%1$s&format=json', $settings['access_tokens']['linkedin'] );
}
Then second change in the same file
case 'linkedin':
$authorization_url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&**scope=r_basicprofile**&state=%1$s&client_id=%2$s&redirect_uri=%3$s';
I change above code to
case 'linkedin':
$authorization_url = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&state=%1$s&client_id=%2$s&redirect_uri=%3$s';