THis seems to work well. The only challenge is that when pulling the data down from the databin the event series values needs to be converted to numbers using the ToExpression. Just throw the data into the query hash and the bin is the bin shortid
I have written a gem to do this now.
RubyGems: wolfram_databin gem Github: wolfram_databinCaveat as mathematica does not handle underscores well the gem converts keys _ to U. eg transaction_count become transactionUcount. This the same as in the java bindings for mathematica.
Code:
url="https://datadrop.wolframcloud.com/api/v1.0/Add?"
query= {bin: bin, revenue: revenue, transaction_count: transaction_count, distributors: distributors, average: avg}
res=''
begin
Timeout::timeout(40) do
@uri=URI.parse(url)
clnt = HTTPClient.new
res=clnt.get(@uri,query)
end
rescue Exception e
puts "Exception: e.inspect"
ensure
puts "result: res.inspect query ubin: bin url: url
end
end