PHP code example of lukaswhite / podcast-feed-parser

1. Go to this page and download the library: Download lukaswhite/podcast-feed-parser library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lukaswhite / podcast-feed-parser example snippets


use Lukaswhite\PodcastFeedParser\Parser;

$parser = Parser();
$parser->load('/path/to/feed/feed.rss');
$podcast = $parser->run();

$parser = Parser();
$parser->setContent(/** raw content */);
$podcast = $parser->run();

$podcast = $parser->run();
$id = $db->insert(
    'podcasts',
    [
        'title' =>  $podcast->getTitle(),
        'description' => $podcast->getDescription(),
        'artwork' => $podcast->getArtwork()->getUri(),
    ]
);

foreach($podcast->getEpisodes() as $episode) {
    $db->insert(
        'episodes',
        [
            'podcast_id' => $id,
            'guid' => $episode->getGuid(),
            'title' =>  $episode->getTitle(),
            'description' => $episode->getDescription(),
            'media_uri' => $podcast->getMedia()->getUri(),
        ]
    );
}

return $podcast->getEpisodes()->mostRecent();
bash
composer