0.0
No commit activity in last 3 years
No release in over 3 years
OpenRTB Ruby Client
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 5.2
~> 10.3
~> 1.18

Runtime

~> 2.3.6
~> 3.2.0
~> 1.10.1
~> 1.0.0
~> 1.0.2
~> 0.6.9
 Project Readme

OpenRTB Client Build Status Gem Version

Installation

gem install openrtb-client

Usage

client = OpenRTB::Client.new do |cli|
  cli.proxy      = 'http://myproxy.net:5367'
  cli.user_agent = 'myadserver/1.0'
  cli.version    = '2.2'
  cli.logger     = Logger.new($stdout)
  cli.max_concurrency = 2
end

req = {
  id: "23629773",
  at: 2,
  tmax: 150,
  imp: [
    {
      id: "1",
      tagid: "0",
      banner: {
        w: 320,
        h: 50,
        battr: [
          10,
          14002,
          9
        ],
      }
    }
  ],
  site: {
    id: "90000",
    domain: "http://rtb.automatethistestplz.com",
    page: "http://66.150.149.26/qa/rst-mob-23-43-qa-ndb.html"
  },
  device: {
    ua: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36",
    ip: "64.60.206.226",
    language: "en",
    devicetype: 1,
  },
  user: {
    id: "091016c886a3676cc7371e291aae0146741357xc",
    ext: {
      sessiondepth: 1
    }
  }
}

res = client.execute do |queue|
  queue.post('http://api.example.com/exchange.json', req)
  queue.post('http://user:pass@api.another-example.com/exchange.json', req)
end

if res.any?
  win = res.max_by { |r| r[:seatbid][:bid].first[:price].to_i }
  puts win.inspect
end

Copyright

Copyright (c) 2014 Realmedia Latin America. See LICENSE for details.