Пример #1
0
 /**
  * Hent ut data fra RSS
  */
 public static function get_changes()
 {
     global $_base;
     $url = self::$url;
     // hent xml
     $data = @file_get_contents($url);
     if (!$data) {
         return false;
     }
     // les xml
     try {
         $xml = new SimpleXMLElement($data);
     } catch (Exception $e) {
         sysreport::exception($e);
         return false;
     }
     // hent ut det vi skal ha
     $result = array();
     foreach ($xml->channel->item as $item) {
         $time = $_base->date->parse($item->pubDate)->format("U");
         #$author = isset($item->author) ? (string)$item->author : '';
         $result[] = array("title" => (string) $item->title, "time" => $time, "link" => (string) $item->link, "description" => (string) $item->description, "category" => (string) $item->category);
     }
     return $result;
 }