Additional fields in podcasts rss
This commit is contained in:
@@ -43,8 +43,13 @@ QUERY;
|
||||
* RSS-feed van alle podcasts
|
||||
*/
|
||||
public function rss(Request $request) {
|
||||
$podcasts = $this->retrievePodcasts($page = 1, $count = 20, $filter = null, $params = []);
|
||||
$view = view('rss.podcasts')->with('podcasts', $podcasts);
|
||||
$page = (int)$request->get('page', 1);
|
||||
if($page <= 0) {
|
||||
return abort(400);
|
||||
}
|
||||
|
||||
$podcasts = $this->retrievePodcasts($page, $count = 20, $filter = null, $params = []);
|
||||
$view = view('rss.podcasts')->with('podcasts', $podcasts)->with('url', $request->url())->with('page', $page);
|
||||
return response($view)->header('Content-Type', 'application/xml');
|
||||
}
|
||||
|
||||
|
||||
@@ -4,34 +4,51 @@
|
||||
xmlns:spotify="http://www.spotify.com/ns/rss"
|
||||
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
|
||||
|
||||
<channel>
|
||||
<title>NH Gooi Gemist</title>
|
||||
<description>Fragmenten en interviews eerder te horen op NH Gooi Radio</description>
|
||||
<link>https://nhgooi.nl</link>
|
||||
<language>nl-nl</language>
|
||||
<itunes:author>NH Gooi Radio</itunes:author>
|
||||
<itunes:explicit>no</itunes:explicit>
|
||||
<itunes:image href="https://nhgooi.nl/images/logo.png" />
|
||||
<itunes:owner>
|
||||
<itunes:email>info@nhgooi.nl</itunes:email>
|
||||
</itunes:owner>
|
||||
<itunes:category text="News & Politics"></itunes:category>
|
||||
<spotify:countryOfOrigin>nl</spotify:countryOfOrigin><spotify:countryOfOrigin>nl</spotify:countryOfOrigin>
|
||||
<channel>
|
||||
<title>NH Gooi Gemist</title>
|
||||
<description>Fragmenten en interviews eerder te horen op NH Gooi Radio</description>
|
||||
<link>https://nhgooi.nl</link>
|
||||
<language>nl-nl</language>
|
||||
|
||||
<link rel="first" href="{{$url}}?page=1"/>
|
||||
<link rel="next" href="{{$url}}?page={{$page + 1}}"/>
|
||||
@if($page != 1)
|
||||
<link rel="previous" href="{{$url}}?page={{$page - 1}}"/>
|
||||
@endif
|
||||
|
||||
@foreach($podcasts as $podcast)
|
||||
<item>
|
||||
<title>{{$podcast->title}}</title>
|
||||
<itunes:summary>{{$podcast->content}}</itunes:summary>
|
||||
<description>{{$podcast->content}}</description>
|
||||
<link>https://nhgooi.nl/podcast/download/{{$podcast->url}}</link>
|
||||
<pubDate>{{$podcast->created->format('r')}}</pubDate>
|
||||
<itunes:author>NH Gooi Radio</itunes:author>
|
||||
<itunes:explicit>no</itunes:explicit>
|
||||
<itunes:image href="https://nhgooi.nl/images/logo.png" />
|
||||
<itunes:owner>
|
||||
<itunes:name>NH Gooi Radio</itunes:name>
|
||||
<itunes: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>{{$podcast->title}}</title>
|
||||
<description>{{$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>
|
||||
<guid>https://nhgooi.nl/podcast-{{$podcast->id}}</guid>
|
||||
</item>
|
||||
@endforeach
|
||||
@if($podcast->image)
|
||||
<itunes:image href="https://nhgooi.nl{{$podcast->image->url}}"/>
|
||||
@endif
|
||||
</item>
|
||||
@endforeach
|
||||
|
||||
</channel>
|
||||
</channel>
|
||||
</rss>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user