function get_podcast($address, $station_name) { // fetch the feed, everything default $feed = new SimplePie(); $feed->set_cache_duration(60 * 60 * 12); //12 hours $feed->set_feed_url($address); $feed->init(); $feed->handle_content_type(); //get and print 7 episodes foreach ($feed->get_items(0, 7) as $item) { $episode = new Episode($station_name, $item); $episode->print_html(); } }