Coder Social home page Coder Social logo

film_snob's Introduction

film_snob

Build Status Gem Version Code Climate Test Coverage

Helps parse URLs of web videos.

Installation

Add this line to your application's Gemfile:

gem "film_snob"

And then execute:

$ bundle

Or install it yourself as:

$ gem install film_snob

Usage

film = FilmSnob.new("https://www.youtube.com/watch?v=GwT3zH16w3s")
film.embeddable? #=> true
film.site       #=> :youtube
film.id         #=> "GwT3zH16w3s"
film.title      #=> "What Are You, The Coolest? With Robert Rodriguez"
film.html       #=> "<iframe width=\"480\" height=\"270\" src=\"http://www.youtube.com/embed/GwT3zH16w3s?feature=oembed\" frameborder=\"0\" allowfullscreen></iframe>"

Can also pass some configuration options like this:

film = FilmSnob.new("http://vimeo.com/64683454", width: 720)
film.title #=> "Garann Means - Bacon is bad for you"
film.html  #=> "<iframe src=\"//player.vimeo.com/video/64683454\" width=\"720\" height=\"405\" frameborder=\"0\" title=\"Garann Means - Bacon is bad for you\" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>"

film_snob uses the oembed protocol to get html for embed codes. These options assume some knowledge of the endpoint's API. The above vimeo example works because they have an extensively documented API which allows tons of configuration. The other two don't seem to have any documentation or configuration at all.

Supported video providers

  • YouTube
  • Vimeo
  • Hulu
  • Funny or Die
  • Coub
  • Instagram
  • Dailymotion
  • Vine
  • Rutube

The same methods work with all of these providers.

Testing

Run rake to run all of the rspecs.

Code Style

Run rubocop and try to keep the cops happy.

Questions?

![Gitter](https://badges.gitter.im/Join Chat.svg)

Ping me in the Gitter chat room or create a GitHub issue

Contributing

  1. Fork it ( https://github.com/maxjacobson/film_snob/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am "Add some feature")
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

film_snob's People

Contributors

carlosplusplus avatar davydovanton avatar edgibbs avatar gitter-badger avatar lurraca avatar maxjacobson avatar priteshjain avatar vjustov avatar wilchandler avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.