General

Response Formats

All URLs that output your TimeStream data respond to the following extensions:

  • .csv
  • .html
  • .json
  • .pdf
  • .rss
  • .txt
  • .xml

Just add the extension to any TimeStream URL in your browser to see examples or use cURL if you want to use the API. Below are some examples.

Methods

Get current task

Here's an example of how to use cURL to get your current task.

# GET the current task
# Response can be JSON, TXT or XML depending on your request
# Sample response: This is my awesome task
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/current.txt

This is an example to get the amount of time spent on the current task.

# GET the current task time
# Response is only TXT
# Sample response: 00:02:31
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/current/time.txt

Here's how to get the current task and time together.

# GET the current task and time together
# Response is only TXT
# Sample response: This is my awesome task [00:02:31]
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/current/task-time.txt

And this is how to get the time first, then the task.

# GET the current time and task together
# Response is only TXT
# Sample response: [00:02:31] This is my awesome task
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/current/time-task.txt

Add a task

Here's an example of how to use cURL to POST a new task.

# POST a new task
# Response can be JSON, TXT or XML depending on your request
# Sample response: Success: New task successfully added.
curl -d "password=yourpassword" -d "task=This is some task" -d "source=bash" https://timestreamapp.com/yourusername.txt

Please note that you MUST include a valid "source" when you are posting a new task via the API. The following are valid sources you can use:

  • android
  • bash
  • ipad
  • iphone
  • launchbar
  • linux_client
  • mac_client
  • quicksilver
  • terminal
  • web
  • windows_client

List tasks

Getting a list of tasks is pretty easy. You can retrieve today's list, a specific date or search results. Output formats can be: CSV, HTML, JSON, PDF, RSS, TXT and XML. Here are some examples.

How to get today's tasks:

# GET a list of today's tasks
# Response can be CSV, HTML, JSON, PDF, RSS, TXT or XML depending on your request
# Sample response:
# 00:02:31 This is my awesome task
# 00:04:07 This is my other awesome task
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername.txt

How to get tasks for a specific date:

# GET a list of tasks for a specific date
# Response can be CSV, HTML, JSON, PDF, RSS, TXT or XML depending on your request
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/2011-05-19.json

And how to get search results:

# GET a list of tasks from a search result
# Response can be CSV, HTML, JSON, PDF, RSS, TXT or XML depending on your request
curl -G -d "password=yourpassword" https://timestreamapp.com/yourusername/search/foo+bar.xml

Ruby gem

Ruby Gem

The easiest way to interact with TimeStream from the command line is to simply use the Ruby gem. You can install it with:

gem install timestreamapp

Check out the documentation on GitHub or watch the screencast below.

Git/Subversion integration

Bash Wrappers

Below is a link to some helpful bash wrapper functions to make it easier to include your current task in your commit messages.