Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • rave
  • ORIGINAL_2007
3 results

functions.inc.php

Blame
  • Forked from Digital Experience Group / UNL_Alert
    Up to date with the upstream repository.
    user avatar
    Kevin Abel authored
    b61b8927
    History
    functions.inc.php 692 B
    <?php
    
    function getCAPData($config)
    {
        try {
            $url = isset($config['proxyUrl']) ? $config['proxyUrl'] :'http://www.getrave.com/rss/unl/channel1'; 
            $alerts = new UNL_Alert_RaveRSS($url);
            
            if (!empty($config['recentTimeframe'])) {
                $filtered = new UNL_Alert_RecentPubDateFilter($alerts->getIterator(), $config['recentTimeframe']);
            } else {
                $filtered = new UNL_Alert_RecentPubDateFilter($alerts->getIterator());
            }
            
            $data = new UNL_Alert_RSSToCAP($filtered);
            $output = $data->getData();
        } catch (Exception $e) {
            $output = array();
        }
    
        return new UNL_Alert_ArrayObject($output);
    }