|
@@ -1,7 +1,9 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
|
|
|
+<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
|
|
|
<channel>
|
|
|
+<atom:link href="http://www.ondarossa.info{{ ror.url | escape("html_attr") }}" rel="self" type="application/rss+xml" />
|
|
|
<title>Radio Onda Rossa</title>
|
|
|
+<link>http://www.ondarossa.info</link>
|
|
|
<language>it-it</language>
|
|
|
<itunes:subtitle>La radio di chi se la sente</itunes:subtitle>
|
|
|
<itunes:author>Ondarossa</itunes:author>
|
|
@@ -16,33 +18,36 @@
|
|
|
<itunes:category text="News & Politics"/>
|
|
|
|
|
|
{% for nid, node in ror.podcast.nodes %}
|
|
|
-<item>
|
|
|
+ {% set num_audios = ror.podcast.audio[nid]|length %}
|
|
|
{% for num, audio in ror.podcast.audio[nid] %}
|
|
|
+ <item>
|
|
|
{% set audiourl = audio.field_audio_link[0].uri %}
|
|
|
{% set ext = audiourl|split('.')|last %}
|
|
|
{% set durata = audio.field_durata[0].value %}
|
|
|
{% set duratamin = durata // 60 %}
|
|
|
{% set duratasec = durata % 60 %}
|
|
|
- <title> {{node.getTitle()}} </title>
|
|
|
- <itunes:summary>Description of podcast episode content</itunes:summary>
|
|
|
- <description> {{ node.get('body').getValue().0.value }} </description>
|
|
|
- <link>http://example.com/podcast-1</link> {# node.getLink#}
|
|
|
+ {% if num_audios > 1 %}
|
|
|
+ <title> {{node.title.0.value}} ({{num+1}}/{{num_audios}}) </title>
|
|
|
+ {% else %}
|
|
|
+ <title> {{node.title.0.value}} </title>
|
|
|
+ {% endif %}
|
|
|
+ <itunes:summary>{{ node.summary | raw }}</itunes:summary>
|
|
|
+ <description> {{ node.body.0.value }} </description>
|
|
|
+ <link>http://www.ondarossa.info{{node.path.0.alias}}</link>
|
|
|
|
|
|
- {# TODO: detect ogg/mp3 #}
|
|
|
- <enclosure url="{{ audiourl }}" type="audio/{{ext}}" length="1024"></enclosure>
|
|
|
- {# TODO: formatta pubDate #}
|
|
|
- <pubDate>Thu, 21 Dec 2016 16:01:07 +0000</pubDate>
|
|
|
+ <enclosure url="{{ audiourl | replace({"https://": "http://"}) | escape('html_attr') }}" type="audio/{{ext}}" length="1024"></enclosure>
|
|
|
+ <pubDate>{{ "@#{node.created.0.value}" | date("r") }}</pubDate>
|
|
|
<itunes:author>Redazione Ondarossa</itunes:author>
|
|
|
<itunes:duration>00:{{"%02d" | format(duratamin)}}:{{"%02d" | format(duratasec)}}</itunes:duration>
|
|
|
<itunes:explicit>no</itunes:explicit>
|
|
|
<guid>{{ audiourl }}</guid>
|
|
|
+ </item>
|
|
|
{% endfor %}
|
|
|
{# [fields]
|
|
|
- {% for field in node.getFields() %}
|
|
|
- [[ {{ field.getName() }} ]]
|
|
|
- {% endfor %}
|
|
|
+ {% for field in node.getFields() %}
|
|
|
+ [[ {{ field.getName() }} ]]
|
|
|
+ {% endfor %}
|
|
|
[/fields] #}
|
|
|
-</item>
|
|
|
{% endfor %}
|
|
|
|
|
|
</channel>
|