SAAS-772: Send metadata to Tunein
This is pretty much working except with master source metadata
This commit is contained in:
parent
b023f191e3
commit
4451c49c06
4 changed files with 99 additions and 24 deletions
|
@ -4,12 +4,12 @@ class Application_Common_TuneIn
|
|||
{
|
||||
public static function sendMetadataToTunein($title, $artist)
|
||||
{
|
||||
$tuneInStationID = null;
|
||||
$tuneInPartnerKey = null;
|
||||
$tuneInPartnerID = null;
|
||||
$tuneInStationID = Application_Model_Preference::getTuneinStationId();
|
||||
$tuneInPartnerID = Application_Model_Preference::getTuneinPartnerId();
|
||||
$tuneInPartnerKey = Application_Model_Preference::getTuneinPartnerKey();
|
||||
|
||||
$qry_str = "?partnerId=".$tuneInPartnerID."&partnerKey=".$tuneInPartnerKey."&id=".$tuneInStationID
|
||||
."&title=".$title."&artist=".$artist;
|
||||
."&title=".$title."&artist=".$artist."&commercial=false";
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, TUNEIN_API_URL . $qry_str);
|
||||
|
@ -17,13 +17,12 @@ class Application_Common_TuneIn
|
|||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
|
||||
$jsonData = curl_exec($ch);
|
||||
curl_exec($ch);
|
||||
if (curl_error($ch)) {
|
||||
Logging::error("Failed to reach TuneIn: ". curl_errno($ch)." - ". curl_error($ch) . " - " . curl_getinfo($ch, CURLINFO_EFFECTIVE_URL));
|
||||
}
|
||||
curl_close($ch);
|
||||
|
||||
$arr = json_decode($jsonData, true);
|
||||
Logging::info($arr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue