Created
April 24, 2013 08:10
-
-
Save jmcampanini/5450485 to your computer and use it in GitHub Desktop.
Simple script to pull Task Names from asana based on git commit messages.
This file contains 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
from asana import asana | |
import sys | |
import os | |
key_file = os.path.expanduser("~") + "/.ssh/asana.key" | |
asana_api_key = open(key_file).read().strip() | |
asana_api = asana.AsanaAPI(asana_api_key, debug=True) | |
task_ids = [] | |
tasks = [] | |
for line in sys.stdin: | |
line = line.strip() | |
if "asana" in line: | |
slashed = line.split("/") | |
task_id = int(slashed[-1]) | |
task_ids.append(task_id) | |
print "Found Task: ", task_id | |
for task_id in task_ids: | |
task = asana_api.get_task(task_id) | |
tasks.append(task) | |
# print just the names | |
for task in tasks: | |
print "-", task["name"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment