-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
vine_feed.erb
36 lines (33 loc) · 1.24 KB
/
vine_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
29
30
31
32
33
34
35
36
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>vine:<%= @id %></id>
<title><%= @user %> on Vine</title>
<icon>https://v.cdn.vine.co/w/a0e7f0dc-assets/images/favicon.ico</icon>
<link href="<%= request.original_url.esc %>" rel="self" />
<link href="https://vine.co/<%= @username %>" rel="alternate" />
<updated><%= Time.parse(@data[0]["created"]) if @data[0] %></updated>
<%-
@data.each do |post|
if post["repost"]
title = "Revine #{post["username"]}: #{post["description"]}"
else
title = post["description"]
end
-%>
<entry>
<id>vine:post:<%= post["postId"] %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id>
<title><%= title.to_line.esc %></title>
<link href="<%= post["permalinkUrl"].esc %>" />
<updated><%= Time.parse(post["created"]) %></updated>
<author><name><%= post["username"] %></name></author>
<content type="html">
<%= <<-EOF.undent.esc
<iframe width="600" height="600" scrolling="no" frameborder="no" src="#{post["permalinkUrl"]}/embed/simple" allowfullscreen></iframe>
<p>#{post["description"]}</p>
<a href="#{request.root_url}/vine/download?url=#{post["shareUrl"]}">Download video</a>
EOF
-%>
</content>
</entry>
<%- end -%>
</feed>