Skip to content

Instantly share code, notes, and snippets.

@wifeofvillon
Last active November 14, 2018 03:52
Show Gist options
  • Save wifeofvillon/5e4dadc1e08e9b37c57b8a3a7a970880 to your computer and use it in GitHub Desktop.
Save wifeofvillon/5e4dadc1e08e9b37c57b8a3a7a970880 to your computer and use it in GitHub Desktop.

How to Use Pixela

Memorandum about steps to create new Pixela user and graph (MacOS 10.13.4)

Create New User

I used sha256hash text as the value of token

$ shasum -a 256
{string}{Ctrl+D}
{sha256hash}
$ curl -X POST https://pixe.la/v1/users -d '{"token":"${sha256hash}", "username":"wifeofvillon", "agreeTermsOfService":"yes", "notMinor":"yes"}'
{"message":"Success.","isSuccess":true}'

Create New Graph

$ curl -X POST https://pixe.la/v1/users/wifeofvillon/graphs -H 'X-USER-TOKEN:${sha256hash}' -d '{"id":"test-graph","name":"graph-name","unit":"commit","type":"int","color":"shibafu","timezone":"Asia/Tokyo"}'

Then, the new graph has been created

test-graph

Type it if wanna get via CUI:

$ curl -X GET https://pixe.la/v1/users/wifeofvillon/graphs/test-graph

Update Pixela Values (POST)

$ curl -X POST https://pixe.la/v1/users/wifeofvillon/graphs/test-graph -H 'X-USER-TOKEN:${sha256token}' -d '{"date":"20181113","quantity":"5"}'

Then, 5 is reflected on Nov, 13 in the graph

test-graph

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