Skip to content

Instantly share code, notes, and snippets.

@albanpeignier
Created October 12, 2012 10:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albanpeignier/3878506 to your computer and use it in GitHub Desktop.
Save albanpeignier/3878506 to your computer and use it in GitHub Desktop.
Rivendell::API example
irb(main):004:0> require 'rivendell/api'
irb(main):005:0> xport = Rivendell::API::Xport.new(:host => "sandbox")
=> #<Rivendell::API::Xport:0x00000002572518 @host="sandbox">
irb(main):006:0> xport.add_cart :group => "MUSIC"
=> #<Rivendell::API::Cart:0x000000022168d8 @number=10002, @type="audio", @group_name="MUSIC", @title="[new cart]", ...
irb(main):008:0> xport.add_cut 10002
=> #<Rivendell::API::Cut:0x000000025021f0 @name="010002_001", @cart_number="10002", @number=1, ...
irb(main):009:0> xport.import 10002, 1, "upurii-first_contact-licence_art_libre.ogg"
=> #<HTTParty::Response:0x21eaee0 parsed_response={"RDWebResult"=>{"ResponseCode"=>"200", "ErrorString"=>"OK"}}, @response=#<Net::HTTPOK 200 OK readbody=true>, @headers={"date"=>["Fri, 12 Oct 2012 09:58:34 GMT"], "server"=>["Apache/2.2.16 (Debian)"], "connection"=>["close"], "transfer-encoding"=>["chunked"], "content-type"=>["application/xml"]}>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment