Did you know that you can navigate the posts by swiping left and right?
Whistle is a dog activity monitor. I’ve just updated my client for their unofficial API.
The original code (circa 2015) was in C# and used WebClient
. For some reason, it just stopped working.
The same calls work in F# using Fsharp.Data
, so I decided to scrap the C# version and create a Jupyter notebook with the minimal F# code needed to access the API.
The original code was informed by an old description of the unofficial API. For this new version, I loaded up Charles Proxy to intercept encrypted traffic between the Whistle Legacy app and the API endpoints. I didn’t notice any differences that were breaking, though it seems the app is sending additional information in the headers that’s not needed to make the API work.
The entire API has not been implemented; that would be extremely tedious! However, unlike v1, I’m providing a semi-complete domain model, using FSharp.Json for serialization. My client captures what I consider to be the core interesting API. However, I have some pointers on how to extend it further if you wish.
All the code is on GitHub. You need to install the F# kernel for Jupyter or just go to Azure notebooks where it is baked in.