Skip to content

Instantly share code, notes, and snippets.

@raytiley
Created July 18, 2012 13:03
Show Gist options
  • Save raytiley/3136082 to your computer and use it in GitHub Desktop.
Save raytiley/3136082 to your computer and use it in GitHub Desktop.
Messed around with customer's file
<?php
date_default_timezone_set('America/New_York');
$client = new SoapClient('http://frontdoor.ctn5.org/CablecastWS/CablecastWS.asmx?WSDL', array('cache_wsdl' => 0));
$searchLength = strtotime(date("Y-m-d")."T".date("H:i:s")) + (60*60*24*35);
$channelID = 1;
$showID = 1;
$schedule = $client->GetScheduleInformation(array(
'ChannelID' => $channelID,
'FromDate' => date("Y-m-d")."T00:00:00",
'ToDate' => date("Y-m-d", $searchLength)."T".date("H:i:s", $searchLength),
'restrictToShowID' => $showID));
//Cast results to an array if not already
$results = is_array($schedule->GetScheduleInformationResult->ScheduleInfo) ?
$schedule->GetScheduleInformationResult->ScheduleInfo :
array($schedule->GetScheduleInformationResult->ScheduleInfo);
var_dump($results);
foreach($results as $run)
{
echo date("r",strtotime($run->StartTime)) . "\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment