-
Notifications
You must be signed in to change notification settings - Fork 0
journal 2020 08 16: Haskell HTTP server setup
Nothing major, just using Scotty:
Perhaps the slightly more major thing, and indeed was the first thing I tried, before I even tried Scotty, was a library of Twitter types. I found this library, twitter-types
(on Hackage), which seems a bit old, but nonetheless seem to work.
- Github page for the library: https://github.com/himura/twitter-types
- A fork contributing ~4 commits (but fell behind ~100 commits): https://github.com/glasserc/twitter-types/tree/add-status
I also have some basic tests set up, and indeed, de-serialisation works.
The Twitter reference docs are showing a syntactically-invalid code-block as their example value for their JSON objects. In this case, it was the example for the Status object (i.e. a tweet) on the reference page for GET statuses/user_timeline
:
Look at how the value part of the JSON expression didn't escape the double-quotes. It caused me a lot of digging around before I found out what was wrong! I thought it was the twitter-types
library that was out-of-date. Apparently no evidence for that yet!