Skip to content

Instantly share code, notes, and snippets.

@Girbons
Created August 25, 2017 14:36
Show Gist options
  • Save Girbons/540f2dcb4e2df61b828fdc14eff05e3a to your computer and use it in GitHub Desktop.
Save Girbons/540f2dcb4e2df61b828fdc14eff05e3a to your computer and use it in GitHub Desktop.
from datadog import initialize, statsd
from rls.rocket import RocketLeague
options = {
'api-key': [DATADOG API-KEY]
}
PROJECT_TAG = 'Rocket League'
ROCKET_API_KEY = [ROCKET LEAGUE STATS API-KEY]
rocket = RocketLeague(ROCKET_API_KEY)
response = rocket.players.player(id=[YOUR ID], platform=[YOUR PLATFORM]).json()
goals = response['stats']['goals']
assists = response['stats']['assists']
mvps = response['stats']['mvps']
saves = response['stats']['saves']
wins = response['stats']['wins']
if __name__ == '__main__':
initialize(**options)
statsd.gauge('rocket.league.goals', goals, tags=[PROJECT_TAG])
statsd.gauge('rocket.league.assists', assists, tags=[PROJECT_TAG])
statsd.gauge('rocket.league.saves', saves, tags=[PROJECT_TAG])
statsd.gauge('rocket.league.wins', wins, tags=[PROJECT_TAG])
statsd.gauge('rocket.league.mvps', mvps, tags=[PROJECT_TAG])
print('Gauge Published')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment