PHP RSS Feed Gallery Generator for Audio

PHP RSS Feed Gallery Generator for Audio


Last Updated   Ratings   Unique User Downloads   Download Rankings
2023-10-19 (Less than 1 hour in the past) RSS 2.0 feed Not but rated by the customers Total: Not but counted Not but ranked
Description  

Author

This package deal can generate an RSS feed and gallery for audio recordsdata.

It can traverse a server-side listing containing audio recordsdata and generate an RSS feed with the record of recordsdata.

The package deal can even generate HTML to show the record of audio recordsdata in a gallery Web web page.

If the package deal finds pictures for every audio file within the scanned listing, it could show them on the gallery Web web page and the RSS feed.

Example


<?php

  /*
      Runs from a listing containing recordsdata to offer an
      RSS 2.0 feed that comprises the record and modification occasions for all of the
      recordsdata.
  */

  require_once('Rss.php');
 
$rss = new Rss();

  perform get_m_time_dir($path){
   
$listing = new RecursiveDirectoryIterator(
     
$path,
     
FilesystemIterator::KEY_AS_PATHNAME |
     
FilesystemIterator::CURRENT_AS_FILEINFO |
     
FilesystemIterator::SKIP_DOTS
   
);
   
$iterator = new RecursiveIteratorIterator(
     
$listing,
     
RecursiveIteratorIterator::SELF_FIRST
   
);
   
$resultFile = $iterator->present();
    foreach(
$iterator as $file) {
      if (
$file->getMtime() > $resultFile->getMtime()) {
       
$resultFile = $file;
      }
    }
    return
$resultFile->getMtime();
  }

  $lastFile = get_m_time_dir('./content material/');

  header('Content-type: textual content/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 primarily based on a listing containing audio recordsdata and robotically save the XML and show the content material present in a web page/gallery

Cover Image

Info

The RSS generator half was created primarily based on this wonderful gist

I acquired information from recordsdata primarily based in getID3. It’s a submodule, situated in feed/getID3

Usage

  1. Download the final launch .zip and extract it in your server
  2. Put your audio recordsdata (simply mp3 for now) in feed/content material/

    You can put pictures with the identical title because the .mp3 recordsdata. The script will acknowledge it and use as cowl pictures for every merchandise

  3. Edit the infos of the podcast in <code>feed/Rss.php</code>:
personal $feedName = 'My Audio Feed';
personal $feedDesc = 'Feed for the my audio recordsdata in some server folder';
personal $feedURL = 'http://www.mysite.com/audio';
personal $express = 'NO'; //express content material?
personal $coverImg = '//localhost/kaiceph/img/play_cover.png'; //cowl picture src
personal $copyright = 'Copyright of feed content material';
personal $language = 'en-us'; //pt-br, en-us

  1. Access your_site.xyz/feed/ first, so it’ll generate the .xml rss feed

HI-FI News

by way of PHP Classes: Latest entries https://ift.tt/Ts49wuR

October 20, 2023 at 04:34AM