5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/eme/bt.rb', line 5
def self.track(data = {}, conn = connection, opts = {}, reload = false)
return nil if data[:master_account_id].nil? || data[:action].nil? || data[:label].nil?
d = { :uid => data[:master_account_id], :act => data[:action], :label => data[:label] }
d[:game] = data[:game] || settings[:game]
d[:res] = data[:resource] || settings[:resource]
d[:md] = data[:metadata] if data[:metadata]
d[:ip] = data[:ip] if data[:ip]
opts[:method] = :post
opts[:body] = URI.encode_www_form(d)
opts[:headers] = {"Content-Type" => "application/x-www-form-urlencoded"}
return do_request("/cast", conn, opts)
end
|