嗨,我试着通过php获取分享的份数。
代码是
$url_social = 'https://www.linkedin.com/countserv/count/share?url=' . urlencode(trim($url)) . '&format=json';
$res = file_get_contents($url_social, false, $context);
输出上面的代码我得到了它
Array
(
[count] => 0
[fCnt] => 0
[fCntPlusOne] => 1
[url] => https://www.botoa.com/contest/detail/40/77/20160428_2
)
但是sam url我尝试使用网址:https://www.linkedin.com/countserv/count/share?url=https%3A%2F%2Fwww.botoa.com%2Fcontest%2Fdetail%2F40%2F77%2F20160428_2&format=json
在浏览器中引导网址返回结果
{
count: 8,
fCnt: "8",
fCntPlusOne: "9",
url: "https://www.botoa.com/contest/detail/40/77/20160428_2"
}
如此不同,你可以看到第一个结果0和第二个8为什么计数?什么是可能的解决方案