-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
61 lines (41 loc) · 1.4 KB
/
index.php
File metadata and controls
61 lines (41 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
namespace dynalist;
include "conf/config.php";
include "autoload.php";
$dynalist_api = new dynalist($dynalist_api_private_key);
$return_docs = $dynalist_api->get_all_documents();
echo "<pre>";
print_r($return_docs);
echo "</pre>";
/*$return_node = $dynalist_api->add_item_to_inbox("Add new line to my default todo list");
echo "<pre>";
print_r($return_node);
echo "</pre>";
*/
$contacts_doc = "a4XeglgMJJKN8l22f2CL5gmn";
$return_data = $dynalist_api->get_document_content($contacts_doc);
echo "<pre>";
print_r($return_data);
echo "</pre>";
//$new_document = new document()
/*
$csv_file = "data/contacts_first.txt";
$csv = array_map('str_getcsv', file($csv_file));
array_walk($csv, function(&$a) use ($csv) {
$a = array_combine($csv[0], $a);
});
array_shift($csv); # remove column header
echo "<pre>";
print_r($csv);
echo "</pre>";
foreach($csv as $curr_item) {
}
*/
// Add a company node
$node[0] = array("action"=>"insert", "parent_id"=>"root", "index"=>0,"content"=>"Company","note"=>"Company view of your data", "checked"=>false);
$node[1] = array("action"=>"insert", "parent_id"=>"root", "index"=>0,"content"=>"People","note"=>"People view of your data", "checked"=>false);
$changes = array($node[0],$node[1]);
$added_nodes = $dynalist_api->set_document_content($contacts_doc,$changes);
echo "<pre>";
print_r($added_nodes);
echo "</pre>";