I am using a PHP script to access the WEB API of gracenote. Though it works sometimes, it gives me a time out error most of the times. Here is the error I am getting:
exception: code=2001, message=Request to a Gracenote WebAPI timed out., ext= PHP Fatal error: Uncaught exception 'Gracenote\WebAPI\GNException' with message 'Request to a Gracenote WebAPI timed out.' in /home/kubuntu/Downloads/php-gracenote-master/php-gracenote-master/php-gracenote/HTTP.class.php:1
Here is my very simple code:
<?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);
What am doing wrong?
You should use try/catch to surround gracenote api calls, gracenote HTTP client throws various of exceptions