This is a Ruby implementation of the API for Bits on the run, a video hosting service. See <www.bitsontherun.com/> for more details.
This is a guideline to what has been implemented based on the API at: docs.bitsontherun.com/system-api/
-
/videos/create
-
/videos/show
-
/videos/templates/list
-
/videos/conversions/list
The following are portions of the API that are currently not covered by the gem:
-
/videos/list
-
/videos/update
-
/videos/delete
-
/videos/templates/show
-
/videos/conversions/show
-
/videos/conversions/create
-
/videos/conversions/delete
-
/videos/thumbnails/show
-
/videos/thumbnails/update
-
All of it
-
All of it
Contributions to this gem are most welcome, fork the gem and send us a pull request :)
Create a new initializer in the config directory:
# RAILS_ROOT/config/initializers/bits_on_the_run.rb BitsOnTheRun::Initializer.run do |config| config.api_key = "api_key" config.api_secret = "api_secret" end
The Video methods implement a behaviour not completely unlike ActiveRecord
To create a new Video object and save it:
video.BitsOnTheRun::Video.new video.save!
Atlernatively, these steps can be wrapped using the .create! method:
video = BitsOnTheRun::Video.create!(:title => video_file_name, :filename => video_path)
After calling .save! or .create!, you’ll probably want to store video.key in persistent storage so you can access the video later.
video = BitsOnTheRun::Video.show(video_key)
Which will return a Video object with the attributes:
- date
-
The date the video was uploaded
- key
-
The video key
- duration
-
The video duration
- filename
-
Filename
- title
-
The title of the video
- tags
-
An array of tags associated with the video
- status
-
The video status
- link
-
link
- description
-
Video description
Videos are converted into web-friendly formats using templates. To access either:
Association-like calls:
video.templates video.conversions
Direct API calls:
BitsOnTheRun::VideoTemplate.list(video_key) BitsOnTheRun::VideoConversion.list(video_key)
Copyright © 2009 Rubaidh Ltd, released under the MIT license