feed.xml.eex 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:itunesu="http://www.itunesu.com/feed" version="2.0">
  3. <channel>
  4. <link><%= @podcast.link %></link>
  5. <language><![CDATA[<%= @podcast.language %>]]></language>
  6. <copyright>&#xA9;2022</copyright>
  7. <webMaster><![CDATA[<%= @podcast.webmaster %>]]></webMaster>
  8. <managingEditor><![CDATA[<%= @podcast.webmaster %>]]></managingEditor>
  9. <image>
  10. <url><%= @podcast.image.url %></url>
  11. <title><![CDATA[<%= @podcast.image.title %>]]></title>
  12. <link><%= @podcast.image.link %></link>
  13. </image>
  14. <itunes:owner>
  15. <itunes:name><![CDATA[<%= @podcast.owner.name %>]]></itunes:name>
  16. <itunes:email><![CDATA[<%= @podcast.owner.email %>]]></itunes:email>
  17. </itunes:owner>
  18. <itunes:category text="<%= HtmlEntities.encode(@podcast.category) %>">
  19. <itunes:category text="<%= HtmlEntities.encode(@podcast.category) %>" />
  20. </itunes:category>
  21. <itunes:keywords><%= @podcast.keywords |> Enum.join(", ") %></itunes:keywords>
  22. <itunes:explicit><![CDATA[<%= @podcast.explicit %>]]></itunes:explicit>
  23. <itunes:image href="<%= @podcast.image.url %>" />
  24. <atom:link href="<%= OpenpodWeb.Endpoint.url <> Routes.feed_path(@conn, :by_identifier, @identifier) %>" rel="self" type="application/rss+xml" />
  25. <pubDate><%= @podcast.pubDate |> Calendar.DateTime.Format.rfc2822 %></pubDate>
  26. <title><![CDATA[<%= @podcast.title %>]]></title>
  27. <itunes:author><![CDATA[<%= @podcast.owner.name %>]]></itunes:author>
  28. <description><![CDATA[<%= @podcast.description %>]]></description>
  29. <itunes:summary><![CDATA[<%= @podcast.description %>]]></itunes:summary>
  30. <itunes:subtitle><![CDATA[<%= Regex.run(~r/\A(.{0,255})(?: |\.|\Z)/, @podcast.description) |> List.last() %>]]></itunes:subtitle>
  31. <lastBuildDate><%= @podcast.lastBuildDate |> Calendar.DateTime.Format.rfc2822 %></lastBuildDate>
  32. <%= for item <- @items do %>
  33. <item>
  34. <title><![CDATA[<%= item.title %>]]></title>
  35. <link><%= item.link %></link>
  36. <pubDate><%= item.pubDate |> Calendar.DateTime.Format.rfc2822 %></pubDate>
  37. <description><![CDATA[<%= item.description %>]]></description>
  38. <enclosure url="<%= item.link %>" length="<%= item.size %>" type="audio/mpeg"/>
  39. <guid><%= item.link %></guid>
  40. <itunes:duration><%= item.length |> format_length %></itunes:duration>
  41. <itunes:summary><%= item.summary %></itunes:summary>
  42. <itunes:keywords><![CDATA[<%= item.keywords |> Enum.join(", ") %>]]></itunes:keywords>
  43. <itunes:explicit><%= item.explicit %></itunes:explicit>
  44. <itunes:image href="<%= item.image || @podcast.image.url %>" />
  45. </item>
  46. <% end %>
  47. </channel>
  48. </rss>