Giter Site home page Giter Site logo

avatargetter's Introduction

FIRSTMap Avatar Getter

This program downloads FRC avatars from the FRC API (https://frc-events.firstinspires.org/services/API) and stores them in a sprite sheet. This is used to update the FRC avatars for FIRSTMap (data/avatars.png and data/avatars.json in the FIRSTMap repository). It merges the old avatar sprite sheet with the new avatars, so it can be run during the time teams are allowed to upload new avatars without deleting the old ones for teams that have not uploaded an FRC avatar for the new season (yet).

It must be called with the FIRSTMap data folder as an argument. It uses the teams.json as a list of the teams to save avatars for (if avatars for those teams are available) and skips all other avatars. If there is no avatar available for a team from the FRC API, but there is one (most likely from a previous year) in a previously generated avatar sprite sheet in the FIRSTMap data directory, it will be copied to the new sprite sheet. For example, if team 1234 does not have an avatar for the 2019 season, but there is an avatar in the avatars.png / avatars.json sprite sheet in the FIRSTMap data directory left over from the 2018 season, it will be copied to the new sprite sheet that is being generated.

Usage:

Create a file called FRC_API_KEY in the root of the repository and add your FRC API key in the following format:

api_username:api-key-guid

See https://frcevents2.docs.apiary.io/#/reference/authorization for more info about FRC API key formatting. The program will automatically base64 encode the key when it loads it.

FRC API keys cannot be redistributed, so an API key cannot be included in the repository. An FRC API key can be obtained from https://frc-events.firstinspires.org/services/API.

The YEAR file can be used to specify what year to get avatars for. Otherwise, it will get the current year using the system time.

The program can be run after installing the .NET Core SDK (version 3.0 Preview 8 or later).

Run the program by executing:

dotnet run [firstmap-data-folder]

The program creates an avatars.png and avatars.json in the project root. Copy these to the FIRSTMap data folder and replace the old avatars sprite sheet.

avatargetter's People

Contributors

ethshaw 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.