Aletheia
Aletheia is truth or disclosure (...) The literal meaning of the word ἀλήθεια is "the state of not being hidden; the state of being evident."
Aletheia is an HTTP client library for the Guardian's content API written in Rust.
How to use it
Aletheia requires Tokio as a dependency to execute asynchronous code.
Simply add aletheia and tokio to the list of dependencies in your Cargo.toml file.
[]
= "0.1.1"
= { = "1", = ["full"] }
You also need an API key to be able to make requests. Keys can be requested here.
Example
Let's say you were interested in finding five film, play or album reviews with a rating of 5 stars containing the word "politics" published from October to December 2021. The code would look something like the example below, and would consist of three steps:
- Constructing the HTTP client
- Building the query
- Parsing the response
use *;
use GuardianContentClient;
use Error;
async
The above will return the following results.
"Licorice Pizza review – Paul Thomas Anderson’s funniest and most relaxed film yet"
by Peter Bradshaw (https://www.theguardian.com/p/jtm7m)
"Rina Sawayama review – superstar status cemented by pop’s politician"
by Fergal Kinney (https://www.theguardian.com/p/jh9tx)
"Burning review – the searing black summer documentary that Australia deserves"
by Luke Buckmaster (https://www.theguardian.com/p/jeqg5)
"Harry Potter and the Philosopher’s Stone review – 20 years on, it’s a nostalgic spectacular"
by Peter Bradshaw (https://www.theguardian.com/p/japa7)
"‘Some of art’s most luxurious orgies’ – Poussin and the Dance review"
by Jonathan Jones (https://www.theguardian.com/p/j5kkp)