comparison app/views/tweets/_tweet.html.erb @ 237:961d362e42c7 legit-client

The url in entity media isn't unique as they all point to the same thing
author nanaya <me@nanaya.net>
date Sat, 15 Jul 2023 01:47:34 +0900
parents 7a773720d81f
children be0b78fb5f57
comparison
equal deleted inserted replaced
236:498043313523 237:961d362e42c7
41 </p> 41 </p>
42 42
43 <p> 43 <p>
44 <% tweet[:entity_media].each do |_short_url, media| %> 44 <% tweet[:entity_media].each do |_short_url, media| %>
45 <% if media[:type] == 'photo' %> 45 <% if media[:type] == 'photo' %>
46 <%= link_to "#{media[:url]}?name=orig" do %> 46 <%= link_to "#{media[:image_url]}?name=orig" do %>
47 <%= image_tag "#{media[:url]}?name=small", :alt => "attachment #{media[:id]}" -%> 47 <%= image_tag "#{media[:image_url]}?name=small", :alt => "attachment #{media[:id]}" -%>
48 <% end %> 48 <% end %>
49 <% elsif media[:type] == 'video' %> 49 <% elsif media[:type] == 'video' %>
50 <%= video_tag media[:variants] 50 <%= video_tag media[:variants]
51 .sort_by { |variant| -variant[:bitrate] } 51 .sort_by { |variant| -variant[:bitrate] }
52 .map { |variant| variant[:url] }, width: '100%', controls: true 52 .map { |variant| variant[:url] }, width: '100%', controls: true