We’re going to write a “read it later”-tool (ril) in Go, and test it using the BATS (Bash Automated Testing System). Its purpose is to save URLs to an SQLite database for later viewing.
Each URL is assigned an integer id. IDs are formatted right-aligned in fields of width 4. The ID used in the examples below is 17.
A newly added URL is retrieved and the <title> element is parsed (e.g. https://www.example.com -> Example Domain). Use a User-Agent string containing “Read-it-later”. If the URL does not resolve with a 200 status, use “[Unknown Title]” as the title.