fixed README; fixed debug output
This commit is contained in:
parent
eb3916c84e
commit
080cbad43f
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required (VERSION 3.7)
|
||||
project (mastodon-cpp
|
||||
VERSION 0.1.0
|
||||
VERSION 0.1.1
|
||||
LANGUAGES CXX
|
||||
)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
|
||||
|
|
14
README.md
14
README.md
|
@ -16,7 +16,7 @@ All versions below 1.0.0 (SOVERSION 0) are considered insecure, unstable and can
|
|||
|
||||
### Development version
|
||||
|
||||
git clone https://…
|
||||
git clone https://github.com/tastytea/mastodon-cpp.git
|
||||
|
||||
## Compile
|
||||
|
||||
|
@ -25,7 +25,7 @@ All versions below 1.0.0 (SOVERSION 0) are considered insecure, unstable and can
|
|||
cmake ..
|
||||
make
|
||||
|
||||
If you want to compile a debug build, use `cmake -DCMAKE_BUILD_TYPE=Debug`
|
||||
If you want to compile a debug build, use `cmake -DCMAKE_BUILD_TYPE=Debug ..`
|
||||
instead.
|
||||
|
||||
# Usage
|
||||
|
@ -50,16 +50,16 @@ If you use a debug build, you get more verbose error messages.
|
|||
# TODO
|
||||
|
||||
* Version 0.1.0
|
||||
* [x] Implement all GET methods
|
||||
* [x] Implement all GET calls
|
||||
* [x] Usable error handling
|
||||
* [x] Network stuff
|
||||
* [x] Comprehensive example
|
||||
* Version 0.2.0
|
||||
* [ ] Implement all PATCH methods
|
||||
* [ ] Implement all POST methods
|
||||
* [ ] Implement all DELETE methods
|
||||
* [ ] Implement all PATCH calls
|
||||
* [ ] Implement all POST calls
|
||||
* [ ] Implement all DELETE calls
|
||||
* Version 0.3.0
|
||||
* [ ] Handling HTTP statuses 301 & 302
|
||||
* [ ] Handle HTTP statuses 301 & 302
|
||||
* Later
|
||||
* [ ] Escape user input
|
||||
* [ ] Asynchronous I/O
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "macros.hpp"
|
||||
#include "mastodon-cpp.hpp"
|
||||
|
||||
using namespace Mastodon;
|
||||
|
@ -74,7 +75,7 @@ const std::uint16_t API::get(const Mastodon::API::v1 &call,
|
|||
strcall = "/api/v1/timelines/public";
|
||||
break;
|
||||
default:
|
||||
cerr << "ERROR: Invalid call.\n";
|
||||
ttdebug << "ERROR: Invalid call.\n";
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
@ -168,7 +169,7 @@ const std::uint16_t API::get(const Mastodon::API::v1 &call,
|
|||
strcall = "/api/v1/timelines/list/" + argument;
|
||||
break;
|
||||
default:
|
||||
cerr << "ERROR: Invalid call.\n";
|
||||
ttdebug << "ERROR: Invalid call.\n";
|
||||
return 1;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -32,8 +32,7 @@ int main(int argc, char *argv[])
|
|||
"only_media=1"
|
||||
};
|
||||
|
||||
ret = masto.get(API::v1::accounts_id_statuses, uid,
|
||||
parameters, answer);
|
||||
ret = masto.get(API::v1::accounts_id_statuses, uid,parameters, answer);
|
||||
if (ret == 0)
|
||||
{
|
||||
std::cout << answer << '\n';
|
||||
|
@ -64,6 +63,11 @@ int main(int argc, char *argv[])
|
|||
return ret;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "Error code: " << ret << '\n';
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Reference in New Issue