/
vidme_feed.erb
28 lines (26 loc) · 1.14 KB
/
vidme_feed.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%- content_type :atom -%>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>vidme:<%= @user_id %></id>
<title><%= @username %> on Vidme</title>
<icon>https://cdn.vid.me/images/favicon-96x96.png</icon>
<link href="<%= request.original_url.esc %>" rel="self" />
<link href="https://vid.me/<%= @username %>" rel="alternate" />
<updated><%= Time.parse(@data[0]["date_completed"]) if @data[0] %></updated>
<%- @data.each do |video| -%>
<entry>
<id>vidme:video:<%= video["video_id"] %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id>
<title>[<%= video["duration"].round.to_duration %>] <%= video["title"].to_line.esc %></title>
<link href="https://vid.me/<%= video["url"] %>" />
<updated><%= Time.parse(video["date_completed"]) %></updated>
<author><name><%= @username.esc %></name></author>
<content type="html">
<%= <<~EOF.esc
<iframe width="852" height="480" scrolling="no" frameborder="no" src="https://vid.me/e/#{video["url"]}" allowfullscreen referrerpolicy="no-referrer"></iframe>
#{video["description"].to_paragraphs}
EOF
-%>
</content>
</entry>
<%- end -%>
</feed>