From 73b48b5415790b69eafb4f2190c37e7241c82511 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 22 Jan 2018 04:45:12 +0100 Subject: [PATCH] bugfix, /api/v1/statuses was in the wrong function, small documentation fixes --- CMakeLists.txt | 2 +- README.md | 5 +++-- src/api_post.cpp | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e00a6c3..aa804a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7) include(GNUInstallDirs) project (mastodon-cpp - VERSION 0.1.4 + VERSION 0.1.5 LANGUAGES CXX ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") diff --git a/README.md b/README.md index e836fec..52089fc 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Install with `make install`. # Usage -The HTML reference can be generated with `build_doc.sh`, if doxygen is installed. Or just look in `src/mastodon-cpp.hpp`. There are examples in `src/examples/`. All input is expected to be UTF-8. +The HTML reference can be generated with `build_doc.sh`, if doxygen is installed. Or just look in `src/mastodon-cpp.hpp`. There are examples in `src/examples/`. ## Most basic example @@ -51,7 +51,7 @@ The HTML reference can be generated with `build_doc.sh`, if doxygen is installed int main() { - Mastodon::API masto("social.example.com", "secret_token"); + Mastodon::API masto("social.example.com", "auth_token"); std::string answer; masto.get(API::v1::accounts_verify_credentials, answer); std::cout << answer << '\n'; @@ -89,6 +89,7 @@ If you use a debug build, you get more verbose error messages. * [x] Escape user input * [x] Implement all PATCH calls * [x] Implement all POST calls + * [ ] Implement all PUT calls * [ ] Implement all DELETE calls * Version 0.3.0 * [ ] Handle HTTP statuses 301 & 302 diff --git a/src/api_post.cpp b/src/api_post.cpp index 3ad58ff..381453a 100644 --- a/src/api_post.cpp +++ b/src/api_post.cpp @@ -60,6 +60,9 @@ const std::uint16_t API::post(const Mastodon::API::v1 &call, case v1::reports: strcall = "/api/v1/reports"; break; + case v1::statuses: + strcall = "/api/v1/statuses"; + break; default: ttdebug << "ERROR: Invalid call.\n"; return 1; @@ -112,9 +115,6 @@ const std::uint16_t API::post(const Mastodon::API::v1 &call, case v1::lists_id_accounts: strcall = "/api/v1/lists/" + argument + "/accounts"; break; - case v1::statuses_id: - strcall = "/api/v1/statuses/" + argument; - break; case v1::statuses_id_reblog: strcall = "/api/v1/statuses/" + argument + "/reblog"; break;