Get the thumbnails from Youtube, Vimeo and İzlesene videos for Ruby.
And it may support more video hoster with your contributions.
Add it to your Gemfile:
gem 'video_thumb'
and run on terminal:
$ bundle
or install the gem on terminal.
$ gem install video_thumb
url
Youtube or Vimeo video link
http://www.youtube.com/watch?v=iEPTlhBmwRg
or
or
http://www.izlesene.com/video/feder-goodbye-feat-lyse/7886121
size (not compatible with izlesene)
default = large
small (Youtube: 120x90, Vimeo: 100x75)
medium (Youtube: 320x180, Vimeo: 200x150)
large (Youtube: 640x480, Vimeo: 640xauto)
max (Youtube: original, Vimeo: 640xauto)
require 'video_thumb' # if you're not use Rails 4
VideoThumb::get("http://vimeo.com/101419884")
# returns large thumbnail from Vimeo video
# http://i.vimeocdn.com/video/483188148_640.jpg
VideoThumb::get("http://www.youtube.com/watch?v=iEPTlhBmwRg", "medium")
# returns medium thumbnail from Youtube video
# https://img.youtube.com/vi/iEPTlhBmwRg/mqdefault.jpg
VideoThumb::get("http://www.izlesene.com/video/feder-goodbye-feat-lyse/7886121")
# returns large thumbnail from Vimeo video
# http://i2.imgiz.com/rshots/7886/feder-goodbye-feat-lyse_7886121-8807_1200x630.jpg
- open-uri
- json
- nokogiri
- Fork it ( https://github.com/tgezginis/video_thumb/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Thanks deegz - akosipc - adzierzanowski