Skip to content

Commit

Permalink
filling out bin file
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 3, 2008
1 parent 3c89db0 commit ee1e129
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions bin/earworm
100644 → 100755
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env ruby

require 'rubygems'
require 'earworm'
require 'yaml'

CONFIG = File.join(File.expand_path(ENV['HOME']), '.earworm')
config = YAML.load_file(CONFIG)

(puts("USAGE: #{$0} unknown_file") || exit) unless ARGV[0]

ew = Earworm::Client.new(config['key'])
track =
if File.exists?(ARGV[0])
ew.identify(:file => ARGV[0])
else
ew.identify(:puid => ARGV[0])
end

puts "Title: #{track.title}" if track.title
puts "Artist: #{track.artist}" if track.artist
track.puid_list.each do |puid|
puts "PUID: #{puid}"
end

1 change: 1 addition & 0 deletions lib/earworm/track.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Earworm
class Track
attr_accessor :title, :artist_name, :puid_list
alias :artist :artist_name
def initialize
@title = nil
@artist_name = nil
Expand Down

0 comments on commit ee1e129

Please sign in to comment.