PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

有关pinnacle sports api 插件 限五秒更新的规避方式

原创
2016-06-06 20:43:23 1609浏览

官网如下:http://www.pinnaclesports.com/information.aspx?id=36128

官方网站有限五秒更新。
有没有什么方式可以让时间缩短到1秒 或2-3秒的。

Api 数据抓取方式如下:

$url = 'https://api.pinnaclesports.com/v1/feed?sportid=3&leagueid=233&oddsformat=2';
$credentials = base64_encode("账号:密码");
$header[] = 'Content-length: 0';
$header[] = 'Content-type: application/json';
$header[] = 'Authorization: Basic ' . $credentials;
$httpChannel = curl_init();
curl_setopt($httpChannel, CURLOPT_URL, $url);
curl_setopt($httpChannel, CURLOPT_RETURNTRANSFER, true);
curl_setopt($httpChannel, CURLOPT_HTTPHEADER, $header);
curl_setopt($httpChannel, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($httpChannel);
curl_close($httpChannel);

有没有那位神人有这方面的经验可以供小弟参考一下 ,好让我有个方向可以来进行实验。当然用过这个api的人肯定不多。但求有神人有,「类似」这方面,「规避限时更新」的经验可分享,感谢

回复内容:

官网如下:http://www.pinnaclesports.com/information.aspx?id=36128

官方网站有限五秒更新。
有没有什么方式可以让时间缩短到1秒 或2-3秒的。

Api 数据抓取方式如下:

$url = 'https://api.pinnaclesports.com/v1/feed?sportid=3&leagueid=233&oddsformat=2';
$credentials = base64_encode("账号:密码");
$header[] = 'Content-length: 0';
$header[] = 'Content-type: application/json';
$header[] = 'Authorization: Basic ' . $credentials;
$httpChannel = curl_init();
curl_setopt($httpChannel, CURLOPT_URL, $url);
curl_setopt($httpChannel, CURLOPT_RETURNTRANSFER, true);
curl_setopt($httpChannel, CURLOPT_HTTPHEADER, $header);
curl_setopt($httpChannel, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($httpChannel);
curl_close($httpChannel);

有没有那位神人有这方面的经验可以供小弟参考一下 ,好让我有个方向可以来进行实验。当然用过这个api的人肯定不多。但求有神人有,「类似」这方面,「规避限时更新」的经验可分享,感谢

使用五个账号

美女,你这个事情搞定了没?我也正想开发一个代码来获取Pinnacle Sports的数据。不过获得账号很麻烦,你知道他们有公用测试账号么。你可以使用一个账号通过API获得基本信息,比如:比赛场次和时间,然后自己写HTTP请求,不断的获取网页内容,得到你想要的数据并规避五秒限制。

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。