
Here’s a little script I wrote this afternoon to allow you to add tasks to your Checkvist todo list by e-mailing them to yourself (or having them e-mailed to you!)
The script is written in Python, so you need to have Python installed on your system for it to work. Download the script here.
#!/usr/bin/env python
emailusername=''
emailpassword=''
emailserver='imap.gmail.com'
emailfolder='INBOX'
checkvistlogin='Tasks'
checkvistapikey=''
checklistnumber=0
class Checkvist(object):
def connect(self,username,apikey):
self.token=self.post('/auth/login.json', {'username': username, 'remote_key': apikey})
def addTask(self,checklist,task):
self.post('/checklists/%s/tasks.json' % checklist, {'task[position]': 1, 'task[content]': task, 'token': self.token})
def post(self,url,values):
import urllib2,urllib
url = 'http://checkvist.com'+url
req=urllib2.Request(url,urllib.urlencode(values))
response = urllib2.urlopen(req)
data = response.read()
return data.strip('"')
def email_to_checkvist(username,password,server,mailbox,cvusername,apikey,checklist):
import imaplib,re
i=imaplib.IMAP4_SSL(server)
i.login(username,password)
i.select(mailbox)
counter=0
c=Checkvist()
c.connect(cvusername,apikey)
typ,data=i.search(None,'UNSEEN')
for num in data[0].split():
typ, data = i.fetch(num, '(BODY[TEXT])')
tasks = data[0][1].split('\n')
# Mark as read:
i.store(num, '+FLAGS', '\\Seen')
for t in tasks:
if t.startswith('--'): break
c.addTask(checklist,t.strip())
counter=counter+1
return counter
n=email_to_checkvist(emailusername,emailpassword,emailserver,emailfolder,checkvistlogin,checkvistapikey,checklistnumber)
if n>0: print "%d items added"%n
Here’s how I use this:
- I set up a gmail filter which looks for any incoming mail sent to my gmail address with +checkvist on the end (a very useful feature of gmail) and archives it, labelling it with ‘Tasks’ in the process.
- I installed the script on my server at home, and set up a cron job to execute it every 20 minutes.
When the script runs, it checks my gmail (via IMAP), finds any unread messages in the Tasks label, and converts each line of the messages to a task, which is then added to the top of my checklist. (If a line begins with a double-dash (--), it and any following lines are ignored, so as to avoid including my e-mail signature in my todo list). The message(s) are then marked as read in gmail. Nice and simple.
Once you download the script, you will need to fill in the settings in the first few lines, to include:
- Your email address and password
- Your mail server (Gmail’s server is filled in already)
- The name of the folder (or Gmail label) in which new tasks can be found
- The username and api key of your Checkvist account
- The number (find it in the URL) of the checklist you want to add the tasks to.
If you include a due date on the end of the e-mail line, it will be converted as usual by Checkvist.
If you find this useful, please let me know!

Thoughts on Unsheffield
By Martin on June 21, 2009
Had my first experience of an unconference this weekend. An interesting event, although not as different to a traditional conference as I was expecting. Continue reading “Thoughts on Unsheffield”
Posted in Comments, Events, Social media | Tagged unsheffield | Leave a response