Last Updated | | Ratings | | Unique User Downloads | | Download Rankings |
2023-10-19 (10 months ago) | | Not yet rated by the users | | Total: 31 | | All time: 11,087 This week: 78 |
|
Description | | Author |
This package can generate an RSS feed and gallery for audio files.
It can traverse a server-side directory containing audio files and generate an RSS feed with the list of files.
The package can also generate HTML to display the list of audio files in a gallery Web page.
If the package finds images for each audio file in the scanned directory, it may display them on the gallery Web page and the RSS feed. Innovation Award
October 2023
Number 6 |
A podcast can be implemented as a PHP application that can generate an RSS feed that lists the podcast episode audio files.
It should also provide a page to present the podcast episodes so that users can see the list and play each episode if they want to listen to the audio.
This package can present a podcast on the website page, including the podcast episode list, the podcast RSS feed, and a gallery of images for the podcast episodes in a way that can be nice for the podcast audience.
Manuel Lemos |
| |
|
|
Innovation award
Nominee: 6x |
|
Example
<?php
/*
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
files.
*/
require_once('Rss.php');
$rss = new Rss();
function get_m_time_dir($path){
$directory = new RecursiveDirectoryIterator(
$path,
FilesystemIterator::KEY_AS_PATHNAME |
FilesystemIterator::CURRENT_AS_FILEINFO |
FilesystemIterator::SKIP_DOTS
);
$iterator = new RecursiveIteratorIterator(
$directory,
RecursiveIteratorIterator::SELF_FIRST
);
$resultFile = $iterator->current();
foreach($iterator as $file) {
if ($file->getMtime() > $resultFile->getMtime()) {
$resultFile = $file;
}
}
return $resultFile->getMtime();
}
$lastFile = get_m_time_dir('./content/');
header('Content-type: text/xml');
if(file_exists('rss_feed.xml') && (filemtime('rss_feed.xml') >= $lastFile)){
$xmlRss = file_get_contents('rss_feed.xml');
echo $xmlRss;
} else {
echo $rss->generateFeed();
}
|
Details
rss-gallery-generator
Generate a RSS Feed based on a directory containing audio files and automatically save the XML and display the content found in a page/gallery
Info
The RSS generator part was created based in this amazing gist
I got info from files based in getID3. It's a submodule, located in feed/getID3
Usage
-
Download the last release .zip and extract it in your server
-
Put your audio files (just mp3 for now) in feed/content/
You can put images with the same name as the .mp3 files. The script will recognize it and use as cover images for each item
-
Edit the infos of the podcast in <code>feed/Rss.php</code>:
private $feedName = 'My Audio Feed';
private $feedDesc = 'Feed for the my audio files in some server folder';
private $feedURL = 'http://www.mysite.com/audio';
private $explicit = 'NO'; //explicit content?
private $coverImg = '//localhost/kaiceph/img/play_cover.png'; //cover image src
private $copyright = 'Copyright of feed content';
private $language = 'en-us'; //pt-br, en-us
-
Access your_site.xyz/feed/ first, so it will generate the .xml rss feed
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.