class AdtekioAdnetworks::Revenue::Tapsense

Public Instance Methods

data(from, to) click to toggle source
# File lib/adtekio_adnetworks/importers/revenue/tapsense.rb, line 16
def data(from, to)
  require 'mechanize'
  agent = Mechanize.new
  agent.user_agent_alias = 'Mac Safari'

  agent.post("https://dashboard.tapsense.com/console/login", {
               :username   => credentials.username,
               :password   => credentials.password}.to_json,
             {"Content-Type" => "application/json",
               "Accept"      => "application/json" })

  uri = Addressable::URI.new
  uri.query_values = {
    :start_date  => from.strftime("%Y-%m-%d"),
    :end_date    => to.strftime("%Y-%m-%d"),
    :format      => :json,
    :rollup      => "date,country",
    :action_type => "report"
  }
  url = "https://dashboard.tapsense.com/console/publisher/report"
  agent.get("%s?%s" % [url, uri.query]).body
end
report(from,to) click to toggle source
# File lib/adtekio_adnetworks/importers/revenue/tapsense.rb, line 13
def report(from,to)
end
revenues(from, to) click to toggle source
# File lib/adtekio_adnetworks/importers/revenue/tapsense.rb, line 10
def revenues(from, to)
end