updated header location for mastodon-cpp

This commit is contained in:
tastytea 2018-04-09 18:04:43 +02:00
parent 717d49175a
commit 1f69e0cd62
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
5 changed files with 6 additions and 5 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastobotmon
VERSION 0.3.3
VERSION 0.3.4
LANGUAGES CXX)
include(GNUInstallDirs)

View File

@ -7,7 +7,7 @@
* Tested OS: Linux
* C++ compiler (tested: gcc 6.4, clang 5.0)
* [cmake](https://cmake.org/) (tested: 3.9.6)
* [mastodon-cpp](https://github.com/tastytea/mastodon-cpp) (at least: 0.6.0)
* [mastodon-cpp](https://github.com/tastytea/mastodon-cpp) (at least: 0.8.6)
* [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (tested: 1.8.1)
## Get sourcecode

View File

@ -17,7 +17,7 @@
#include <iostream>
#include <string>
#include <cstdint>
#include <mastodon-cpp.hpp>
#include <mastodon-cpp/mastodon-cpp.hpp>
#include "version.hpp"
#include "mastobotmon.hpp"

View File

@ -134,7 +134,8 @@ int main(int argc, char *argv[])
uint16_t ret = acc.get(Mastodon::API::v1::accounts_verify_credentials, answer);
if (ret == 0)
{
if (std::stoi(acc.get_header("X-RateLimit-Remaining")) < 2)
if (!acc.get_header("X-RateLimit-Remaining").empty() &&
std::stoi(acc.get_header("X-RateLimit-Remaining")) < 2)
{
cerr << "ERROR: Reached limit of API calls.\n";
cerr << "Counter will reset at " << acc.get_header("X-RateLimit-Reset") << '\n';

View File

@ -20,7 +20,7 @@
#include <string>
#include <cstdint>
#include <jsoncpp/json/json.h>
#include <mastodon-cpp.hpp>
#include <mastodon-cpp/mastodon-cpp.hpp>
using std::uint16_t;
using std::string;