bluealliance
bluealliance is a node.js wrapper for The Blue Alliance's web api that is optimized for scouting software.
Installation
Open a terminal in your projects directory and type:
npm install bluealliance
bluealliance and it's dependencies should now be installed in your node_modules folder
Documentation
Documentation for this wrapper can be found at http://7308deep.vision/bluealliance
Examples
getTeam()
to get a team name.
Example 1: Using var BlueAlliance = require("bluealliance");
var tba = new BlueAlliance("Your API key here");
var main = async function() {
var team = await tba.getTeam(7308);
console.log(team.nickname); // Prints "DeepVision"
}
main();
getMatchesAtEvent()
and getTeamsInMatch()
to get info on a specific team from a specific event and match.
Example 2: Using var BlueAlliance = require("bluealliance");
var tba = new BlueAlliance("Your API key here");
var main = async function() {
var event = await tba.getEvent('casj', 2017); // SVR 2017
var matches = await tba.getMatchesAtEvent(event);
var teams = await tba.getTeamsInMatch(matches[12]); // 12th match
console.log(teams.red[1].nickname); // Prints "The Funky Monkeys", playing as the second alliance member in the 12th match at SVR 2017
}
main();