Code Monkey home page Code Monkey logo

urfquiz's Introduction

The URF quiz.

This is the source for The URF Quiz (http://urfquiz.com), including:

  • Data collection scripts, which download and process URF game data.
  • Backend: A Flask application server.
  • Frontend: The website itself.

Data collection and processing pipeline

The script that downloads data is dataCollection/matchDownloader.py. It queries (well, queried, since URF is now finished) the API Challenge endpoint for all NA URF games and downloads each one's stats into its own file, continually doing so until stopped. In our run it kept up with all games it was offered, collecting over 60k games.

We then use gamesToDataframe.py, which takes in the game data and outputs a pickled Pandas dataframe, and then dataframeToWinrates.py, which takes in the dataframe and outputs winrates. We do some hand massaging of that data, involving renaming champions ("MonkeyKing" => "Wukong", "MissFortune" => "Miss Fortune", etc. since our Javascript expects them to be in their normal human readable form.

Backend application server

urfserver.py is a Flask (http://flask.pocoo.org/) server which provides an endpoing that translates our winrate statistics into quiz questions about those winrates. Hitting its /questions/ URL gets you back a JSON list of questions, which the frontend displays for the player to answer.

In the deployed site, it's run as a uWSGI application behind an nginx server, but the script itself can serve the static frontend content during testing.

Frontend website

The website is in the /static/ directory. It queries the backend server for questions and presents them to the player, scoring them on their success.

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.