Skip to content

Instantly share code, notes, and snippets.

@atesgoral
Created July 6, 2009 19:07
Show Gist options
  • Save atesgoral/141619 to your computer and use it in GitHub Desktop.
Save atesgoral/141619 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python2.4
import sys, email, urllib
print 'reQall Router invoked'
msg = email.message_from_file(sys.stdin)
content = msg['subject'].split(': ', 1)[1]
print 'Adding: ' + content
query = urllib.urlencode({
'token': 'my_secret_token',
'project_id': 579713,
'priority': 1,
'date_string': 'today',
'content': content
})
res = urllib.urlopen('http://todoist.com/API/addItem?' + query)
print 'Response: ' + res.read()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment