From c244b2bb945a3d1a6ba3f2fc7c36c1e3b062eea4 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 3 Mar 2019 11:22:11 +0100 Subject: [PATCH] Updated README-examples. --- README.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 946ca4a..22236b9 100644 --- a/README.md +++ b/README.md @@ -29,15 +29,13 @@ There are [examples](https://schlomp.space/tastytea/mastodon-cpp/src/branch/mast ```C++ #include -#include #include int main() { Mastodon::API masto("social.example.com", "auth_token"); - std::string answer; - masto.get(Mastodon::API::v1::accounts_verify_credentials, answer); - std::cout << answer << '\n'; + std::cout << masto.get(Mastodon::API::v1::accounts_verify_credentials); + std::cout << std::endl; } ``` @@ -48,7 +46,6 @@ Using the `Easy`-class. ```C++ #include #include -#include #include #include @@ -57,10 +54,9 @@ using Mastodon::Easy; int main() { Easy masto("social.example", ""); - std::string answer; - masto.get(Mastodon::API::v1::timelines_public, answer); + return_call ret = masto.get(Mastodon::API::v1::timelines_public); - for (const std::string &str : Easy::json_array_to_vector(answer)) + for (const std::string &str : Easy::json_array_to_vector(ret.answer)) { Easy::Status status(str); std::cout << " " << status.account().acct() << " wrote:\n";