-
Notifications
You must be signed in to change notification settings - Fork 2
Follow all
Follow these steps to get location updates from all icecondor users who have friended you.
Use the web site to request a login email. Copy the url from the big red button in the email.
From: system@icecondor.com
Subject: IceCondor Login Button
https://icecondor.com/auth/browser_key-12345678....
Open a websocket connection to the API endpoint, and use the auth.sesion and stream.follow methods to create a stream of location updates from all friends.
$ ./wsscat wss://api.icecondor.com/v2
{"id":"0","method":"auth.session","params":{"device_key":"browser_key-123456789..."}}
{"id":"1","method":"stream.follow","params":{"type":"location","follow":true}}
The response to the stream.follow method (note the id associates the response to the request) is a "stream id", a list of friends, and a mapping of user_id to username.
{"id":"1","result":{"stream_id":"8474d846","added":[{"id":"c0000b-bbb","username":"someuser"}]}}
For each friend on your list, the most recent point will be sent immediately. For as long as the websocket is held open, new updates will be delivered as they are received. Location updates are part of the 'stream' and use an id field of the stream_id returned earlier.
{"id":"8474d846","result":{"user_id":"c0000b-bbb", "latitude": ... "longitude": ...}}