Files
api/api/resources/views/rss/podcasts.blade.php
2024-05-06 13:29:40 +02:00

60 lines
2.6 KiB
PHP

<?php header('Access-Control-Allow-Origin: *'); ?>
<?php header('Content-Type: text/xml'); ?>
<{{ '' /* avoid PHP parsing this as short open tag */ }}?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:spotify="http://www.spotify.com/ns/rss"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
<channel>
<title>{{isset($program) ? $program->name : "NH Gooi Gemist"}}</title>
<description>{{isset($program) ? $program->description : "Fragmenten en interviews eerder te horen op NH Gooi Radio"}}</description>
<link>https://nhgooi.nl{{isset($program) ? $program->url : ""}}</link>
<language>nl-nl</language>
<atom:link rel="self" href="{{$url}}?page={{$page}}"/>
<atom:link rel="first" href="{{$url}}?page=1"/>
<atom:link rel="next" href="{{$url}}?page={{$page + 1}}"/>
@if($page != 1)
<atom:link rel="previous" href="{{$url}}?page={{$page - 1}}"/>
@endif
<itunes:author>NH Gooi Radio</itunes:author>
<itunes:explicit>no</itunes:explicit>
<itunes:image href="https://nhgooi.nl/images/logo_sqr_hq.png" />
<itunes:owner>
<itunes:name>NH Gooi Radio</itunes:name>
<itunes:email>{{isset($program) ? $program->email : 'info' }}@nhgooi.nl</itunes:email>
</itunes:owner>
<itunes:category text="News">
<itunes:category text="Politics" />
<itunes:category text="News Commentary" />
</itunes:category>
<spotify:countryOfOrigin>nl</spotify:countryOfOrigin>
@foreach($podcasts as $podcast)
<item>
<guid>https://nhgooi.nl/podcast-{{$podcast->id}}</guid>
<title>{{html_entity_decode($podcast->title)}}</title>
<description>{{html_entity_decode($podcast->content)}}</description>
<link>https://nhgooi.nl/gemist/fragment/{{$podcast->url}}</link>
<enclosure url="{{url('podcast/download' . $podcast->url . '?auth=' . $podcast->auth)}}" type="audio/mpeg" length="{{filesize($podcast->getSoundFile())}}"></enclosure>
<pubDate>{{$podcast->created->format('r')}}</pubDate>
<itunes:title>{{$podcast->title}}</itunes:title>
<itunes:author>NH Gooi Radio</itunes:author>
<itunes:summary>{{$podcast->content}}</itunes:summary>
<itunes:duration>{{$podcast->formatDuration()}}</itunes:duration>
<itunes:explicit>no</itunes:explicit>
@if($podcast->image)
<itunes:image href="https://nhgooi.nl{{$podcast->image->url}}"/>
@elseif($podcast->program && $podcast->program->image)
<itunes:image href="https://nhgooi.nl{{$podcast->program->image->url}}"/>
@endif
</item>
@endforeach
</channel>
</rss>