Coder Social home page Coder Social logo

openrtb's Introduction

This repository contains OCaml code to validate requests and responses as specified by OpenRTB, in Version 2.0 of the specification. The specification is formalized using ATD, in file openrtb.atd. The tool atdgen generates OCaml serializer and deserializers from this specification. To validate a request contained in file request-file.js :

$ ./validate -request request-file.js

To validate a response in file response-file.js :

$ ./validate -response response-file.js

Secondly, the repository contains all of the examples contained in Version 2.0 document. In several cases, the examples were modified to conform to the specification, or vice-versa. See details below.

Finally, the repository contains an SCGI "bidder" server, in which the details of request de-serialization and response serlialization are abstracted away. This server can be deployed behind any web server which supports the SCGI protocol, e.g. Apache or Nginx. The file test_bidder.ml implements a dummy bidder, which returns the same minimalistic response, independent of the request. Deploying it behind Nginx, on uri /test-bidder/, on port 8080, and on the same host as the web server, requires the following stanza in the Nginx's configuration file:

location /test-bidder/ {
    scgi_pass 127.0.0.1:8080;
    include scgi_params;
}

To start the bidder:

$ ./test_bidder -p 8080 &

To make a request, assuming you do so from the same host as the web server:

$ curl --data-binary @simple-banner.js http://localhost/test-bidder/

Why is EigenDog doing this?

We want to learn more about the RTB ecosystem, of which scalable predictive modeling is a significant component.

Dependencies

To build openrtb, you'll need:

Note that each of these may have additional dependencies, namely lwt and ATD

Modifications to Specification and Examples

We made the following changes to the draft specification:

  • removed the keywords field whenever it has a sibling field content, as the latter also contains the keywords field
  • replaced the keyword field with its plural form keywords , and represented it by a list of strings rather than an optional, comma-separated string.
  • represented privacypolicy by a boolean, rather than an integer, following the video example.
  • represented boxingallowed by a boolean, rather than an integer, following the video example.
  • represented protocol by array of integers rather than a single integer, following the video example.

In addition, we made the following changes to the examples:

  • simple-banner.js:
  • changed at to string
  • changed id to string
  • expandable-creative.js:
  • changed at to string
  • video.js:
  • changed at to string
  • in companionad , removed banner field label
  • changed api to array
  • changed season to string
  • response-win-vast-inline.js:
  • added impid field

openrtb's People

Stargazers

Axel Arroyo Braconi avatar Adrien B. avatar  avatar marcus kim avatar

Watchers

marcus kim avatar

Forkers

masdude

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.