我正在使用 PHP 脚本来访问 Gracenote 的 WEB API。虽然它有时会起作用,但大多数时候它会给我一个超时错误。这是我得到的错误:
异常:代码=2001,消息=对 Gracenote WebAPI 的请求超时。,ext=PHP 致命错误:未捕获的异常“Gracenote\WebAPI\GNException”,消息“对 Gracenote WebAPI 的请求超时。” 在 /home/kubuntu/Downloads/php-gracenote-master/php-gracenote-master/php-gracenote/HTTP.class.php:1
这是我非常简单的代码:
<?php
include("./php-gracenote/Gracenote.class.php");
$clientID = "";
$clientTag = "";
$api = new Gracenote\WebAPI\GracenoteWebAPI($clientID, $clientTag);
$userID = "xxxxxxxxxxxxxxxxxx";
echo "UserID = ".$userID."\n";
$results = $api->searchArtist("Bob Dylan");
var_dump($results);
做错了什么?