From e9b0ceb4c924dce9be3db82e8df5e19fb7409347 Mon Sep 17 00:00:00 2001 From: tastytea Date: Wed, 8 Jan 2020 22:29:31 +0100 Subject: [PATCH] Add introduction and an example to readme. --- README.adoc | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 1177d2e..c5a856d 100644 --- a/README.adoc +++ b/README.adoc @@ -15,13 +15,55 @@ :uri-curl: https://curl.haxx.se/ *{project}* is a C++ wrapper for the Mastodon API. It replaces - link:{uri-mastodon-cpp}[mastodon-cpp]. +link:{uri-mastodon-cpp}[mastodon-cpp]. + +We aim to create a library that is comfortable, yet minimal. All API endpoints +from Mastodon and Pleroma are stored in `enum class`es, to counteract typos and +make your life easier. The network-facing code is built on +link:{uri-curl}[libcurl], a mature and stable library that is available on +virtually every operating system. The library does not parse the responses +itself, but returns to you the raw data, because we know everyone has their +favorite JSON library and we don't want to impose our choice on you! + +== Features + +This is still a work in progress; here is a rough overview of the features: + +* [ ] Requests + ** [x] `GET` requests. + ** [x] Streaming `GET` requests. + ** [ ] `POST` requests. + ** [ ] `PATCH` requests. + ** [ ] `PUT` requests. + ** [ ] `DELETE` requests. +* [x] Report maximum allowed character per post. +* [ ] Comfortable access to pagination headers. +* [ ] Comfortable function to register a new “app” (get an access token). == Usage Have a look at the link:{uri-reference}[reference]. -// === Examples +=== Example + +[source,cpp] +-------------------------------------------------------------------------------- +#include "mastodonpp.hpp" +#include + +int main() +{ + mastodonpp::Instance instance{"example.com", {}}; + mastodonpp::Connection connection{instance}; + auto answer{connection.get(mastodonpp::API::v1::instance)}; + if (answer) + { + std::cout << answer << std::endl; + } +} +-------------------------------------------------------------------------------- + +link:{uri-reference}/examples.html[More examples] are included in the reference. == Install