Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby bindings for the API

branch: master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 .gitignore
Octocat-spinner-32 CHANGELOG
Octocat-spinner-32 LICENSE
Octocat-spinner-32 Manifest
Octocat-spinner-32 README.textile
Octocat-spinner-32 Rakefile
Octocat-spinner-32 twaudio-ruby.gemspec
README.textile bindings for Ruby

This gem provides bindings to which allows you to post audio to twitter.

It’s crazy simple and depends on HTTParty. I’ve not
added it as a gem dependency because there are various forks of HTTParty about that you
might want to use and I don’t want to prescribe a certain one

require 'rubygems'
require 'twaudio'

twaudio = 'twitter_user', 'twitter_pass'

# get details of a clip

=> {"message"=>"testing twaudio ruby bindings", "user"=>"danwrong", "listens"=>3, 
"url"=>"", "audio_url"=>"", 
"created_at"=>"Thu, 09 Jul 2009 09:58:48 +0000"}

=> [{"message"=>"testing twaudio ruby bindings", "user"=>"danwrong", 
"listens"=>3, "url"=>"", "audio_url"=>"", 
"created_at"=>"Thu, 09 Jul 2009 09:58:48 +0000"}, {"message"=>"Atmosphere @ Scala", 
"user"=>"danwrong", "listens"=>56, "url"=>"", 
"created_at"=>"Wed, 24 Jun 2009 20:21:11 +0000"}, 
{"message"=>"It always freaks me out when this comes on when I have iTunes on shuffle...", 
"user"=>"danwrong", "listens"=>69, "url"=>"", 
"audio_url"=>"", "created_at"=>"Fri, 19 Jun 2009 10:56:25 +0000"},

# ...and so on

dope_funky_fresh_tune ='mc_flaps.mp3')

twaudio.upload('this shit is the flyest!!!!', dope_funky_fresh_tune)
=> {"message"=>"this shit is the flyest!!!!", "user"=>"danwrong", "listens"=>0, 
"url"=>"", "audio_url"=>"", 
"created_at"=>"Thu, 09 Jul 2009 09:58:48 +0000"}

At the moment it’s just a stupidly thin wrapper around HTTParty but it does the job.

I’ll probably beef it up a little as needed.

Something went wrong with that request. Please try again.