bugfix, /api/v1/statuses was in the wrong function, small documentation fixes

This commit is contained in:
tastytea 2018-01-22 04:45:12 +01:00
parent 83efdf7ce0
commit 73b48b5415
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
3 changed files with 7 additions and 6 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 3.7)
include(GNUInstallDirs) include(GNUInstallDirs)
project (mastodon-cpp project (mastodon-cpp
VERSION 0.1.4 VERSION 0.1.5
LANGUAGES CXX LANGUAGES CXX
) )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -fPIC")

View File

@ -41,7 +41,7 @@ Install with `make install`.
# Usage # 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 ## Most basic example
@ -51,7 +51,7 @@ The HTML reference can be generated with `build_doc.sh`, if doxygen is installed
int main() int main()
{ {
Mastodon::API masto("social.example.com", "secret_token"); Mastodon::API masto("social.example.com", "auth_token");
std::string answer; std::string answer;
masto.get(API::v1::accounts_verify_credentials, answer); masto.get(API::v1::accounts_verify_credentials, answer);
std::cout << answer << '\n'; 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] Escape user input
* [x] Implement all PATCH calls * [x] Implement all PATCH calls
* [x] Implement all POST calls * [x] Implement all POST calls
* [ ] Implement all PUT calls
* [ ] Implement all DELETE calls * [ ] Implement all DELETE calls
* Version 0.3.0 * Version 0.3.0
* [ ] Handle HTTP statuses 301 & 302 * [ ] Handle HTTP statuses 301 & 302

View File

@ -60,6 +60,9 @@ const std::uint16_t API::post(const Mastodon::API::v1 &call,
case v1::reports: case v1::reports:
strcall = "/api/v1/reports"; strcall = "/api/v1/reports";
break; break;
case v1::statuses:
strcall = "/api/v1/statuses";
break;
default: default:
ttdebug << "ERROR: Invalid call.\n"; ttdebug << "ERROR: Invalid call.\n";
return 1; return 1;
@ -112,9 +115,6 @@ const std::uint16_t API::post(const Mastodon::API::v1 &call,
case v1::lists_id_accounts: case v1::lists_id_accounts:
strcall = "/api/v1/lists/" + argument + "/accounts"; strcall = "/api/v1/lists/" + argument + "/accounts";
break; break;
case v1::statuses_id:
strcall = "/api/v1/statuses/" + argument;
break;
case v1::statuses_id_reblog: case v1::statuses_id_reblog:
strcall = "/api/v1/statuses/" + argument + "/reblog"; strcall = "/api/v1/statuses/" + argument + "/reblog";
break; break;