Coder Social home page Coder Social logo

commentator-note-generator's Introduction

commentator-note-generator

Generates commentator notes for a virtual competition livestream, based on the .json response file from the sr.comp.http /matches srcomp API endpoint.

This produces two sections, interleaved;

One has the details of the teams for the upcoming match, and the other has the scores for the previous match.

Normally I send both of these at the same time at the end of the previous match.

I normally also add a lot of manually-inserted details about the teams to the 'upcoming' message. especially their performance in the last match, or some random facts about the school.

Installation

This package has no dependencies, just clone this repo and run the script.

Running

Fetch matches from the API

Use curl to fetch the /matches json response from sr.comp.http into a file.

Example: curl https://srcomp.studentrobotics.org/comp-api/matches > matches.json

Though you won't want to query the production API, because if you're running this script you're likely preparing for a future event.

To do this for future events, you'll need to run your own instance of sr.comp.http, see https://github.com/peterJCLaw/srcomp-http about setting this up.

Run the script

If you're on Windows, I recommend you pipe the results into a file, then use something like Notepad to paste it into Slack/ a Google doc for further editing. This is because we insert tab characters to neaten up the tabular data, and windows CMD replaces tabs with 4 spaces when copying for some reason.

Just run:

python generate-scores-from-matches.py matches.json > messages.txt

Then the messages will be in messages.txt

commentator-note-generator's People

Contributors

adimote avatar

Watchers

 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.