command

#9
by Leon4gr45 - opened

{
"command": "/.msgraph_venv/bin/python - <<'PY'\nimport json, os, urllib.request, urllib.parse\ntoken = open(os.path.expanduser('/.config/microsoft_graph_token')).read().strip()\nlist_id = "AQMkADAwATNiZmYAZC1kMzRmLWQxMDItMDACLTAwCgAuAAADCwyQJ1iQ9028m0GzAVP45wEAEBs77kJbkEqqedAbjJEnBAAGlSiq7AAAAA=="\nurl = f"https://graph.microsoft.com/v1.0/me/todo/lists/{urllib.parse.quote(list_id, safe='')}/tasks"\nreq = urllib.request.Request(url, headers={'Authorization': f'Bearer {token}', 'Accept':'application/json'})\nwith urllib.request.urlopen(req) as resp:\n data = json.load(resp)\nfor i,t in enumerate(data['value'],1):\n print(i, '|', t['title'], '|', t.get('status'), '|', t.get('importance'), '|', t.get('createdDateTime'))\nPY"
}

Sign up or log in to comment