Module: Memorybee

Defined in:
lib/memorybee.rb,
lib/memorybee/version.rb

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.pollObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/memorybee.rb', line 6

def self.poll
  token=ENV['BMNDR_TOKEN'] or
    raise "must define BMNDR_TOKEN!"
  memrise_user=ENV['MEMRISE_USER'] or
    raise "must define MEMRISE_USER!"
  goalname=ENV['BMNDR_GOALNAME'] or
    raise "must define BMNDR_GOALNAME!"

  bee = Beeminder::User.new token
  items = Memrise.new(memrise_user).items
  bee.send goalname, Float(items.gsub(/\D/,''))
end