Skip to content

Commit

Permalink
Try out Atom enclosure link.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Nov 24, 2016
1 parent 32ce604 commit 1e404f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions views/imgur_feed.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
id = "imgur:album:#{image["id"]}"
title = "Album: #{image["title"]} (#{image["images_count"]} images)"
link = "https://imgur.com/a/#{image["id"]}"
img_src = "https://i.imgur.com/#{image["cover"]}h.jpg"
body = <<-EOF.undent.esc
<a href="#{link}"><img src="https://i.imgur.com/#{image["cover"]}h.jpg"></a>
<a href="#{link}"><img src="#{img_src}"></a>
#{image["description"].to_paragraphs}
<p><a href="http://s.imgur.com/a/#{image["id"]}/zip">Download album</a></p>
Expand All @@ -23,8 +24,9 @@
title = "#{image["title"]} [#{image["width"]}x#{image["height"]}]"
link = "https://imgur.com/#{image["id"]}"
ext = image["type"].split("/")[1]
img_src = "https://i.imgur.com/#{image["id"]}h.#{ext}"
body = <<-EOF.undent.esc
<a href="#{link}.#{ext}"><img src="https://i.imgur.com/#{image["id"]}h.#{ext}"></a>
<a href="#{link}.#{ext}"><img src="#{img_src}"></a>
#{image["description"].to_paragraphs}
<p><a href="https://imgur.com/download/#{image["id"]}/#{CGI.escape(image["title"])}">Download</a></p>
Expand All @@ -37,6 +39,7 @@
<id><%= id %><%= ":#{params[:cachebuster]}" if params[:cachebuster] %></id>
<title><%= title.to_line.esc %></title>
<link href="<%= link.esc %>" />
<link href="<%= img_src.esc %>" rel="enclosure" />
<updated><%= Time.at(image["datetime"].to_i) %></updated>
<author><name><%= @username %></name></author>
<content type="html">
Expand Down

0 comments on commit 1e404f3

Please sign in to comment.