Browse Source

Add script to export data to CSV

This can be imported by Libra for Android
master
Chris Smith 14 years ago
parent
commit
79f2b94d1e
1 changed files with 17 additions and 0 deletions
  1. 17
    0
      export.php

+ 17
- 0
export.php View File

1
+<?PHP
2
+
3
+ require('user-data.php');
4
+
5
+ /* For format of user-data.php see comment in data.php.
6
+  *
7
+  * In addition, this script requires a START_DATE constant containing
8
+  * the unix timestamp of the first entry in the $data array.
9
+  */
10
+
11
+ foreach ($data as $week => $value) {
12
+  if ($value != -1) {
13
+   echo date('Y-m-d', strtotime('+' . $week . ' weeks', START_DATE)), ';', $value, "\n";
14
+  }
15
+ }
16
+
17
+?>

Loading…
Cancel
Save