Skip to content

Instantly share code, notes, and snippets.

@lucasuyezu
Created February 2, 2015 05:41
Show Gist options
  • Save lucasuyezu/85a5ebf263f3eb59f8d1 to your computer and use it in GitHub Desktop.
Save lucasuyezu/85a5ebf263f3eb59f8d1 to your computer and use it in GitHub Desktop.
# Setup
$redis = Redis.connect
# Conversion
currency, amount = parse_tweet("0.5 in #USD")
result = convert('USD', 0.5)
reply("#{amount} in #{currency} is #{result}")
$redis.sadd("conversions", "#{amount} in #{currency} at #{Time.now}")
# Checking later
reply("We have made #{$redis.scard("conversions")} conversions so far")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment