Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?

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
You can’t perform that action at this time.