Skip to content

Instantly share code, notes, and snippets.

@dailyinvention
Last active September 2, 2019 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dailyinvention/b3120c6b4d6f632667cf2fc5961ae1dc to your computer and use it in GitHub Desktop.
Save dailyinvention/b3120c6b4d6f632667cf2fc5961ae1dc to your computer and use it in GitHub Desktop.
Function For Displaying Messages from RAVE CAP Feed
/** ALERT MESSAGES ON HOME PAGE */
function cap_parse($url){
$xml = simplexml_load_file($url);
$event = $xml->info->event;
$description=$xml->info->description;
$effective=strtotime($xml->info->effective);
$expires=strtotime($xml->info->expires);
$time = time();
if (($time > $effective) && ($time < $expires)) {
print("<div class=\"alert\"><h2>".$event."</h2><h4><strong>".$description."</strong></h4></div>");
}
}
cap_parse("https://www.getrave.com/cap/<account>/channel1");
cap_parse("https://www.getrave.com/cap/<account>/channel4");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment