summaryrefslogtreecommitdiff
path: root/inbox_for_todoist.widget/todoistinbox.py
diff options
context:
space:
mode:
Diffstat (limited to 'inbox_for_todoist.widget/todoistinbox.py')
-rw-r--r--inbox_for_todoist.widget/todoistinbox.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/inbox_for_todoist.widget/todoistinbox.py b/inbox_for_todoist.widget/todoistinbox.py
new file mode 100644
index 0000000..c350812
--- /dev/null
+++ b/inbox_for_todoist.widget/todoistinbox.py
@@ -0,0 +1,13 @@
+# -*-coding:utf-8 -*
+def main(token='___YOUR TODOIST TOKEN HERE:___'):
+ from todoist.api import TodoistAPI
+ api = TodoistAPI(token)
+ api.sync() # initial sync
+ rank = 0
+ for i in api.state['items']: #going through all the items in todoist
+ if i['project_id'] == 170911352: # if an item is in the inbox
+ if i['checked'] == 0: # if the item is incomplete
+ rank += 1
+ print("<b>", rank, '- </b>', i['content'], "<p class='mini'> </p>") # print name and id
+if __name__ == '__main__':
+ main()