最近Monarch插件发生了一些变化,以便从LinkedIn获得追随者数量。 Monarch插件只能帮助您从个人资料中获取关注者。在Monarch插件中使用LinkedIn API需要公司关注者计数时该怎么办。我做了一些改动。这是monarch plugin_version ='1.2.3': 首先,我们必须更改monarch.php文件
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'] );
}
进行如下更改以获取公司关注者数
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'] );
}
然后在同一个文件中进行第二次更改
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';
我将上面的代码更改为
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';