<commit_before>= Bits on the run

This is a Ruby implementation of the API for Bits on the run, a video hosting
service. See <http://www.bitsontherun.com/> for more details.

= What's Implemented

This is a guideline to what has been implemented based on the API at:
http://docs.bitsontherun.com/system-api/

=== Videos
* /videos/create
* /videos/show

=== Templates and Conversions
* /videos/templates/list
* /videos/conversions/list

= What's Missing

The following are portions of the API that are currently not covered by the gem:

=== Videos
* /videos/list
* /videos/update
* /videos/delete

=== Video Templates
* /videos/templates/show

=== Video Conversions
* /videos/conversions/show
* /videos/conversions/create
* /videos/conversions/delete

=== Video Thumbnails
* /videos/thumbnails/show
* /videos/thumbnails/update

=== Accounts
* All of it

=== Channels
* All of it

Contributions to this gem are most welcome, fork the gem and send us a pull request :)

= How to Use

== Setting the api key and secret

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

== Uploading a video to Bits on the Run

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.


== Selecting a video

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


=== Templates and conversions

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 (c) 2009 Rubaidh Ltd, released under the MIT license<commit_msg>Indent the code in the readme to encourage rdoc formatting to pickup codeblocks.<commit_after>= Bits on the run

This is a Ruby implementation of the API for Bits on the run, a video hosting
service. See <http://www.bitsontherun.com/> for more details.

= What's Implemented

This is a guideline to what has been implemented based on the API at:
http://docs.bitsontherun.com/system-api/

=== Videos
* /videos/create
* /videos/show

=== Templates and Conversions
* /videos/templates/list
* /videos/conversions/list

= What's Missing

The following are portions of the API that are currently not covered by the gem:

=== Videos
* /videos/list
* /videos/update
* /videos/delete

=== Video Templates
* /videos/templates/show

=== Video Conversions
* /videos/conversions/show
* /videos/conversions/create
* /videos/conversions/delete

=== Video Thumbnails
* /videos/thumbnails/show
* /videos/thumbnails/update

=== Accounts
* All of it

=== Channels
* All of it

Contributions to this gem are most welcome, fork the gem and send us a pull request :)

= How to Use

== Setting the api key and secret

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

== Uploading a video to Bits on the Run

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.


== Selecting a video

  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


=== Templates and conversions

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 (c) 2009 Rubaidh Ltd, released under the MIT license
{'fraction_non_alphanumeric': 0.0833495998438415, 'fraction_numerical': 0.0015615850087839158, 'mean_word_length': 4.053254437869822, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3889935', 'n_tokens_mistral': 1581, 'n_tokens_neox': 1497, 'n_words': 587}