Skip to content

Commit

Permalink
fixed up a couple things for the binary to access the library as expe…
Browse files Browse the repository at this point in the history
…cted
  • Loading branch information
danmayer committed Jul 10, 2010
1 parent b4156b1 commit 3a63b09
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions bin/ruby-fitbit
Expand Up @@ -4,32 +4,36 @@ require 'hirb'

if(ARGV[0]!=nil && ARGV[1]!=nil)
fitbit = RubyFitbit.new(ARGV[0],ARGV[1])

begin
date = Time.parse(ARGV[3])
rescue
date = Time.now
end

fitbit.get_data(date)
puts "Fitbit Data for #{date}"
puts "Calories Burned #{fitbit.calories}"
puts "Steps Taken #{fitbit.steps}"
puts "Milkes Walked #{fitbit.miles_walked}"
puts "Activity Levels Durations:"
puts "Sedentary #{fitbit.sedentary_active}"
puts "Lightly #{fitbit.lightly_active}"
puts "Fairly # => {fitbit.fairly_active}"
puts "Fairly # => #{fitbit.fairly_active}"
puts "Very #{fitbit.very_active}"
end

if ARGV[2]!=nil

begin
date = Time.parse(ARGV[3])
rescue
date = Time.now
end

case ARGV[2]
when 'calorie'
puts "calorie data for data #{date}"
data = fitbit.get_calorie_data(date)
when 'activity'
puts "calorie data for data #{date}"
data = fitbit.get_activity_score_data(date)
when 'summary'
#do nothing just print the summary above
else
puts "steps data for data #{date}"
data = fitbit.get_steps_data(date)
Expand Down

0 comments on commit 3a63b09

Please sign in to comment.