Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
pull a list from rtm and dump it in org
import rtm
token = '' # get this somewhere else
# this is the token and secret from the rtm-cli app so I assume putting it here is ok
milk = rtm.createRTM('cbc76268b901ccb8d9fc5f3aebc4ee1f',
'131beea786379309',
token
)
tasks = milk.tasks.getList(filter='list:books status:incomplete')
tasks = tasks.tasks.list[0].taskseries
for task in sorted(tasks, key=lambda x: x.name.replace('The','').strip()):
if hasattr(task.tags, 'tag'):
tags = task.tags.tag
if isinstance(tags, list):
tags = ':{0}:'.format(':'.join(tags))
else:
tags = ':{0}:'.format(tags)
else:
tags = ''
url = task.url or None
title = task.name.strip().replace('[','{').replace(']','}')
if url:
print('* [[{0}][{1}]] {2}'.format(url, title, tags))
else:
print('* {0} {1}'.format(title, tags))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment