SAAS-772: Send metadata to Tunein
This is pretty much working for scheduled metadata - just to need to test with a TuneIn account.
This commit is contained in:
parent
77241bb6fc
commit
cf24c141fd
10 changed files with 179 additions and 2 deletions
29
airtime_mvc/application/common/TuneIn.php
Normal file
29
airtime_mvc/application/common/TuneIn.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
class Application_Common_TuneIn
|
||||
{
|
||||
public static function sendMetadataToTunein($title, $artist)
|
||||
{
|
||||
$tuneInStationID = null;
|
||||
$tuneInPartnerKey = null;
|
||||
$tuneInPartnerID = null;
|
||||
|
||||
$qry_str = "?partnerId=".$tuneInPartnerID."&partnerKey=".$tuneInPartnerKey."&id=".$tuneInStationID
|
||||
."&title=".$title."&artist=".$artist;
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, TUNEIN_API_URL . $qry_str);
|
||||
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
|
||||
|
||||
$jsonData = 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