parseFeed(); $this->title = ucfirst(strtolower($xml->channel->title)); $this->desc = preg_replace( "/
.+<\/p>/", "", $xml->channel->description ); $this->episodes = array(); foreach ($xml->channel->item as $epData) { array_unshift($this->episodes,new Episode($epData)); } //var_dump($this->episodes); } function parseFeed() { // Renew cache if older than 5 minutes if (time() - filemtime("assets/podcast.rss") > 5*60) { $data = file_get_contents("https://feeds.acast.com/public/shows/le-plus-beau-des-voyages"); file_put_contents("assets/podcast.rss",$data); } $cachedFeedData = file_get_contents("tools/podcast.rss"); return simplexml_load_string($cachedFeedData,'SimpleXMLElement', LIBXML_NOCDATA);; } } ?>