Skip to content

Instantly share code, notes, and snippets.

Created December 4, 2014 19:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/005640fb943434d247f4 to your computer and use it in GitHub Desktop.
Save anonymous/005640fb943434d247f4 to your computer and use it in GitHub Desktop.
Harvest: list running co-worker timers

With Basic Auth, who are your co-workers:

$ curl -H 'Authorization: Basic …' -H 'Accept: application/json' https://example.harvestapp.com/people
>   jq 'map(select(.user.is_active)) | map(.user | {first_name: .first_name, last_name: .last_name, id: .id})'
[
  {
    "id": 1234,
    "last_name": "Alice",
    "first_name": "Bobsdaughter"
  },
  {
    "id": 2345,
    "last_name": "Charlie",
    "first_name": "Danielson"
  }
]

What's their running timer (if they have one)? Look at Alice:

$ curl -H 'Authorization: Basic …' -H 'Accept: application/json' 'https://example.harvestapp.com/daily?of_user=1234' |
>   jq '.day_entries | map(select(.timer_started_at)) | .[].notes'
"Working in a coal mine, going down, down..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment