160grad/todoist-alfred-workflow — pull request #1 by yshavit (2014-09-26 04:14:33+00:00)
Title: add output phase

This takes the output of the curl command, strips out only the content,
and outputs it as a notification.

Fixes escaping
==============

Spaces, brackets and semicolons shouldn't be escaped.

Modifies script
==============

Old:

curl --request POST 'https://api.todoist.com/API/addItem' --data "content=$QUERY&priority=1&token=$TOKEN"

New:

RESP=$(curl --request POST 'https://api.todoist.com/API/addItem' --data "content=$QUERY&priority=1&token=$TOKEN")
python -c 'import json; import sys; print json.load(sys.stdin)["content"]' <<< "$RESP"

Add an output step
==================

Title is just "Added task", and Test is `{query}`.