-
-
Save amazingmarvin/91d82dda85908e88e122712e036c1c57 to your computer and use it in GitHub Desktop.
A shell script to start tracking an Amazing Marvin task in Toggl Track.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ------------------------------------------------- | |
# Before running the script, make sure that you understand it. Running code you find on the Internet may damage your system. | |
# ------------------------------------------------- | |
# In Amazing marvin, set the path to this script as "Start time tracking task" in the "System Triggers strategy" like this: | |
# /Path/to/this/script $TASK_TITLE | |
# Replace "YourSecretToken" with your Toggl API token below. | |
# ------------------------------------------------- | |
curl -v -u YourSecretToken:api_token \ | |
-H "Content-Type: application/json" \ | |
-d '{"time_entry":{"description":'"\"$1\""',"created_with":"curl"}}' \ | |
-X POST https://api.track.toggl.com/api/v8/time_entries/start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As an update, I wrote a bit of python to add some more data (Project and Task in toggl) modeled by the secondary category and project respectively, though this code is fairly brittle and relies on exact names matching between marvin and toggl (you may also have to specify the path to marvin; I think there's some PATH weirdness sometimes).