Super simple script to Parse omny FM feed

<?php $html = ""; $rss = "https://omny.fm/shows/podacastname/playlists/podcast.rss"; $xml = simplexml_load_file($rss); /*The following will show all episodes in an rss feed. */ /*$list = $xml->channel->item; for ($i = 0; $i < count($list); $i++) {*/ /*The following will show a specific numbers of posts in an rss feed, in this case there are 10.*/ for($i = 0; $i < 10; $i++){ $title = $xml->channel->item[$i]->title; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; //below we are creating a variable $shortDate to display the date as mm/dd/yy Ex 12/21/19 $shortDate = date("m/d/y", strtotime($pubDate)); //audio is inside and enclousure within the item. $audio = $xml->channel->item[$i]->enclosure['url']; //although we have additional variables set above we are only displaying the URL for the Audio and Title below. $html .= "<div class='playPodcast' audioURL='$audio'><span class='pod-title link'>$title <br /> $shortDate</span></div>"; } echo $html; ?>
Snippet for omny RSS Feeds.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.