Skip to content

Instantly share code, notes, and snippets.

@adambair
Created April 26, 2009 15:06
Show Gist options
  • Save adambair/102060 to your computer and use it in GitHub Desktop.
Save adambair/102060 to your computer and use it in GitHub Desktop.
Post your current iTunes track to Presently.
#!/usr/bin/env ruby
require 'rubygems'
require 'rbosa'
account='xxx'
username='xxx'
password='xxx'
api="https://#{account}.presentlyapp.com/api/twitter/statuses/update.xml"
itunes = OSA.app("iTunes")
if itunes.current_stream_title
title = itunes.current_stream_title
else
title = "#{itunes.current_track.name} - #{itunes.current_track.name}"
end
message = "#music #{title}"
`curl #{api} -u #{username}:#{password} -d status="#{message}"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment