Coder Social home page Coder Social logo

qw-hub-api's Introduction

QW Hub API Test codecov Go Report Card

Web API serving QuakeWorld info

Usage

  1. Rename/edit config.sample.json to config.json.
  2. Rename/edit .env.example to .env.
  3. Build
  4. ./qw-hub-api

Config

See config.sample.json

Example

{
  "port": 3000,
  "servers": {
    "active_server_interval": 4,
    "server_interval": 30,
    "master_interval": 14400,
    "master_servers": [
      "master.quakeworld.nu:27000",
      "master.quakeservers.net:27000",
      "qwmaster.ocrana.de:27000",
      "qwmaster.fodquake.net:27000"
    ]
  },
  "qtv_demo_sources": [
    {
      "address": "de.quake.world:28000",
      "demo_date_format": "ymd",
      "timezone": "UTC"
    },
    {
      "address": "troopers.fi:28000",
      "demo_date_format": "ymd",
      "timezone": "Europe/Helsinki"
    },
    {
      "address": "quake.se:28000",
      "demo_date_format": "Ymd",
      "timezone": "Europe/Stockholm"
    }
  ],
  "streamers": {
    "annihilazor": "anni",
    "quakeworld": "[streambot]",
    "suddendeathTV": "suddendeathTV",
    "vikpe": "XantoM"
  }
}

API endpoints

URL description
/v2/servers All servers
/v2/servers/mvdsv MVDSV servers
/v2/servers/qwfwd QWFWD servers (proxies)
/v2/servers/qtv QTV servers
/v2/servers/<address> Server details
/v2/servers/<address>/lastscores Server lastscores
/v2/servers/<address>/laststats Server laststats
/v2/masters/<address> List of servers on master
/v2/demos Demos from popular servers
/v2/streams Twitch streams casting Quake
/v2/events Events (from Wiki)
/v2/news News (from QuakeWorld.nu)
/v2/forum_posts Forum posts (from QuakeWorld.nu Forum)

Endpoint details

MVDSV servers

/v2/servers/mvdsv

Param Type Example Description
empty include|exclude|only empty=include Include empty servers (default exclude)
hostname string hostname=quake.se Servers matching hostname quake.se
has_player string has_player=xantom Servers where xantom is connected as player
has_client string has_client=xantom Servers where xantom is connected
limit int limit=10 Limit to 10 servers

Demos

/v2/demos

Param Type Default Example Description
q string q=2on2 xantom dm3 Demos where filename matches 2on2, xantom and dm3
mode string mode=2on2 Demos with mode 2on2
qtv_address string qtv_address=quake.se Demos from quake.se qtv server
limit int [1-500] 100 limit=10 Limit to 10 demos

Build

go build

Development

Run locally.

./qw-hub-api

Now you try an endpoint, e.g. http://localhost:3000/v2/servers

Credits

  • eb
  • Tuna
  • XantoM

Related projects

qw-hub-api's People

Contributors

vikpe avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

qw-hub-api's Issues

Add endpoint for demos

List demos from popular servers, such as foppa, troopers. qw.irc.ax, quake.se etc.

suggested params

  • limit
  • sort order (key, dir)
  • mode
  • q (search query)
  • qtv

example

GET /v2/demos?qtv=qw.foppa.dk&q=xantom&mode=2v2&limit=10`

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.