diff --git a/README.md b/README.md index 0c18688..26a893e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,16 @@ Some examples of what the _recorder_'s built-in HTTP server is capable of: #### Last position of a particular user -Retrieve the last position of a particular user. Note that we get the same data as reported by _ocat_. +Retrieve the last position of a particular user. In addition to the values obtained in the [`location` publish](http://owntracks.org/booklet/tech/json/) from the OwnTracks device, there are a few which we return as convenience: + +* `username` contains the name of the user obtained from the publish topic +* `device` contains the user's device name as obtained from the publish topic +* `topic` is the full topic to which the payload was published +* `ghash` is the geohash string which corresponds to `lat` and `lon` +* `isotst` is the ISO timestamp of the publish time (`tst`) +* `disptst` is the same but designed for displaying +* `cc` is the country code of the location point if available in the cache (see below) +* `addr` is the address of the location point if available in the cache ``` $ curl http://127.0.0.2:8083/api/0/last -d user=demo -d device=iphone @@ -40,6 +49,8 @@ $ curl http://127.0.0.2:8083/api/0/last -d user=demo -d device=iphone "device": "iphone", "topic": "owntracks/demo/iphone", "ghash": "u31dmx9", + "isotst": "2015-08-24T08:40:01Z", + "disptst": "2015-08-24 08:40:01", "cc": "DE", "addr": "E40, 01156 Dresden, Germany" } @@ -106,28 +117,31 @@ Some example uses we consider useful: produces CSV. Limit the fields you want extracted with `--fields lat,lon,cc` for example. * `ocat ... --format xml` produces XML. Limit the fields you want extracted with `--fields lat,lon,cc` for example. -``` +```xml - + - 1440395361 - 3000.000000 - 51 - 10.027857 - 29.000000 - -1 - 52.378886 - -1 + 1440405601 + 10.000000 + 262 + 13.602798 + 6.000000 + 18 + 51.062634 + 82 NE - 96 - u1r1upq + 99 + demo + iphone + owntracks/demo/iphone + u31dmx9 + 2015-08-24T08:40:01Z + 2015-08-24 08:40:01 DE - Heidecker Weg 86, 31275 Lehrte, Germany - 2015-08-24T05:55:07Z - 2015-08-24T05:49:21Z + E40, 01156 Dresden, Germany - ... + ``` * `ocat ... --limit 10` @@ -198,6 +212,8 @@ $ ocat --last --user demo --device iphone "device": "iphone", "topic": "owntracks/demo/iphone", "ghash": "u31dmx9", + "isotst": "2015-08-24T08:40:01Z", + "disptst": "2015-08-24 08:40:01", "cc": "DE", "addr": "E40, 01156 Dresden, Germany" }