"title": "This is a new task from Lively"
}), true)
task = JSON.parse(r.content)
JSON.prettyPrint(task)
r = lively.net.Wunderlist.get("tasks/" + task.id, true)
task2 = JSON.parse(r.content)
JSON.prettyPrint(task)
r = lively.net.Wunderlist.patch("tasks/" + task2.id,
JSON.serialize({
"title": "This is a new task has changed!",
"revision": task2.revision,
}), true)
r = lively.net.Wunderlist.get("tasks/" + task.id, true)
task = JSON.parse(r.content)
r = lively.net.Wunderlist.patch("tasks/" + task.id,
JSON.serialize({
"title": "This is a new task has changed!",
"completed": true,
"revision": task.revision,
}), true)
r = lively.net.Wunderlist.get("lists", true)
lists = JSON.parse(r.content)
lists.collect(function(ea) { return ea.title}).join("\n")
inbox = lists.detect(function(ea) { return ea.title == "inbox"})
r = lively.net.Wunderlist.get("tasks?list_id="+inbox.id, true)
tasks = JSON.parse(r.content)
tasks.collect(function(ea) { return "☐ " + ea.title + " @id(" + ea.id + ")"}).join("\n")
inbox = lists.detect(function(ea) { return ea.title == "inbox"})
r = lively.net.Wunderlist.get("tasks?list_id="+inbox.id + "&completed=true", true)
tasks = JSON.parse(r.content)
tasks.collect(function(ea) { return "☐ " + ea.title + " @id(" + ea.id + ")"}).join("\n")