Skip to content

Instantly share code, notes, and snippets.

@gpiancastelli
Last active July 1, 2016 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpiancastelli/057ccdb12b3141e891ac0051446718d4 to your computer and use it in GitHub Desktop.
Save gpiancastelli/057ccdb12b3141e891ac0051446718d4 to your computer and use it in GitHub Desktop.
How to use Poster (Firefox plug-in) to upload a Hearthstone match result to Track-o-bot profile

The popular Track-o-bot Hearthstone tracker offers an API to upload match results to a player's online profile. The simplest way to do it is to download a Firefox plug-in called Poster to send a proper request to the API. After installing it and opening its window, a minimal request can be compiled as follows:

  • URL must be compiled to https://trackobot.com/profile/results.json?username=YOUR_USERNAME&token=YOUR_SECRET_TOKEN where username and token can be obtained on the API page of your online profile Settings section.
  • Content Type must be compiled to application/json.
  • The payload for the request must be a JSON object of the following form:
{
  "result": {
    "hero": "Warlock",
    "opponent": "Hunter",
    "mode": "ranked",
    "win": true,
    "rank": 18,
    "added": "2016-07-01T21:35:00.000Z"
  }
}

To send the request, press POST. A new window will appear with the response details: a HTTP 201 Created code and a response payload composed by the same JSON object you sent in the request when the match has been successfully recorded, a HTTP error and some HTML code explaining the error when the request has been rejected. In case of a successful request, the new entry should immediately be visible on the online profile page.

Some other details can be obtained from a Gist by the author of Track-o-bot, or by looking at the code for the data structure that represents a match result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment