Skip to content

Instantly share code, notes, and snippets.

@dailyinvention

dailyinvention/rave_cap_alert.php Secret

Last active Sep 2, 2019
Embed
What would you like to do?
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
You can’t perform that action at this time.