Skip to content

Commit

Permalink
Embed gfycat.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Oct 26, 2018
1 parent efd6468 commit 111660e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/initializers/05-string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ def embed_html(request=nil)
# http://sverigesradio.se/sida/artikel.aspx?programid=83&artikel=6819392
# http://sverigesradio.se/sida/embed?url=http://sverigesradio.se/sida/artikel.aspx%3Fprogramid=83%26artikel=6819392
"<iframe width='853' height='155' src='https://sverigesradio.se/sida/embed?url=#{CGI.escape(self)}' frameborder='0' scrolling='no' allowfullscreen referrerpolicy='no-referrer'></iframe>"
elsif %r{^https?://gfycat\.com/(?:gifs/detail/)?(?<id>[^@\/?#]+)} =~ self
"<iframe width='640' height='273' src='https://gfycat.com/ifr/#{id}' frameborder='0' scrolling='no' allowfullscreen referrerpolicy='no-referrer'></iframe>"
elsif %r{^https?://(?:www\.)?giphy\.com/gifs/(?:.*-)?(?<id>[0-9a-zA-Z]+)(/|\?|&|#|$)} =~ self
"<img src='https://i.giphy.com/#{id}.gif' referrerpolicy='no-referrer'>"
elsif %r{^https?://[a-z0-9\-._~:/?#\[\]@!$&'()*+,;=]+\.gifv}i =~ self
Expand Down

0 comments on commit 111660e

Please sign in to comment.