Skip to content

Commit

Permalink
Support video.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jun 29, 2015
1 parent a1880f7 commit 80155cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion views/index.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<% if ENV["INSTAGRAM_ACCESS_TOKEN"] %>
<form class="input-group" method="get" action="/instagram" target="_self">
<div class="input-group-addon"><label for="instagram_q">Instagram</label></div>
<input class="form-control" type="search" name="q" id="instagram_q" placeholder="Enter url to an Instagram user.">
<input class="form-control" type="search" name="q" id="instagram_q" placeholder="Enter url to an Instagram post or user.">
<span class="input-group-btn">
<input class="btn btn-primary" type="submit" value="Get RSS Feed">
</span>
Expand Down
8 changes: 6 additions & 2 deletions views/instagram_feed.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@
<%- @data.each do |post| -%>

<entry>
<id>instagram:post:<%= post["id"] %>:<%= Digest::SHA2.hexdigest((post["caption"]["text"] rescue "")) %></id>
<title><%= post["caption"]["text"] rescue "Image" %></title>
<id>instagram:post:<%= post["id"] %>:<%= Digest::SHA2.hexdigest((post["caption"]["text"] rescue "")) %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id>
<title><%= "Video: " if post["type"] == "video" %><%= post["caption"]["text"] rescue "No title" %></title>
<link href="<%= post["link"] %>" />
<updated><%= Time.at(post["created_time"].to_i) %></updated>
<author><name><%= post["user"]["full_name"] %></name></author>
<content type="html">
<% if post["videos"] %>
&lt;iframe src="<%= post["link"] %>/embed/" width="612" height="710" frameborder="0" scrolling="no" allowfullscreen>&lt;/iframe>
<% else %>
&lt;img src="<%= post["images"]["standard_resolution"]["url"] %>">

&lt;p>Filter: <%= post["filter"] %>&lt;/p>
<% end %>
</content>
</entry>
<%- end -%>
Expand Down

0 comments on commit 80155cf

Please sign in to comment.