Giter Site home page Giter Site logo

leaderboard's Introduction

Photo by Alexandra Andersson on Unsplash

leaderboard

Leaderboard style app for gamification of interactions with results from analytics reporting

Installation

  • If you dont have it, install python:
$ brew install python
  • Install pip:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
sudo python get-pip.py
  • Install virtualenv:
sudo pip install -U virtualenv
  • Create new Python virtual environment called venv and activate it
$ virtualenv venv
$ source venv/bin/activate
  • Clone this repository
$ git clone https://github.com/mboyanna/leaderboard.git

Try example

  • Start service
$ cd leaderboard
$ python ws.py
[06/Dec/2018:14:12:38] ENGINE Listening for SIGHUP.
[06/Dec/2018:14:12:38] ENGINE Listening for SIGTERM.
[06/Dec/2018:14:12:38] ENGINE Listening for SIGUSR1.
[06/Dec/2018:14:12:38] ENGINE Bus STARTING
CherryPy Checker:
The Application mounted at '' has an empty config.

[06/Dec/2018:14:12:38] ENGINE Started monitor thread 'Autoreloader'.
[06/Dec/2018:14:12:38] ENGINE Serving on http://0.0.0.0:8080
[06/Dec/2018:14:12:38] ENGINE Bus STARTED

  • Validate service In a different prompt try with curl
$ curl -d '{"metricType": "brand", "metricName": "ctr","triggeringCriteria": ">", "baselineMetricVal": "DKNY", "triggeringMetricVal": "Young Fabulous and Broke"}' -H "Content-Type: application/json" -X POST http://localhost:8080/getLeaderboard

You should get the following response:

"{\n  \"metricType\": \"brand\",\n  \"metricName\": \"ctr\",\n  \"triggeringCriteria\": \">\",\n  \"baselineMetricVal\": \"DKNY\",\n  \"triggeringMetricVal\": \"Young Fabulous and Broke\",\n  \"triggeringTreshold\": 10,\n  \"otherMetrics\": [\n    \"ctr\",\n    \"aov\",\n    \"sales\",\n    \"attr_sales\",\n    \"items\"\n  ],\n  \"recSets\": [\n    {\n      \"value\": \"0.85\",\n      \"leaderName\": \"Adam Nielsen\"\n    },\n    {\n      \"value\": \"0.08\",\n      \"leaderName\": \"Stacy Jackson\"\n    },\n    {\n      \"value\": \"0.06\",\n      \"leaderName\": \"Trisha Firm\"\n    },\n    {\n      \"value\": \"0.06\",\n      \"leaderName\": \"Merchandiser Alan\"\n    },\n    {\n      \"value\": \"0.03\",\n      \"leaderName\": \"Marketeer Hanna\"\n    },\n    {\n      \"value\": \"0.02\",\n      \"leaderName\": \"CoffeeGuy\"\n    },\n    {\n      \"value\": \"0.02\",\n      \"leaderName\": \"Jeff Bezos\"\n    }\n  ]\n}"
"{\"num1\":{\"mean\":2.0,\"min\":1.0,\"max\":3.0},\"num2\":{\"mean\":5.0,\"min\":4.0,\"max\":6.0}}"

leaderboard's People

Contributors

mboyanna avatar

Watchers

James Cloos avatar  avatar

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.