Super simple script to Parse omny FM feed

<?php $html = ""; $rss = "https://omny.fm/shows/podacastname/playlists/podcast.rss"; $xml = simplexml_load_file($rss); for($i = 0; $i < 3; $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.