diff --git a/CMakeLists.txt b/CMakeLists.txt index cbb95a9..c5e639f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project (mastorss - VERSION 0.6.3 + VERSION 0.7.0 LANGUAGES CXX ) diff --git a/README.md b/README.md index d425315..84d51e2 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ The documentation is far from complete, sorry. * [cmake](https://cmake.org/) (tested: 3.9 / 3.11) * [boost](http://www.boost.org/) (tested: 1.65 / 1.62) * [curlpp](http://www.curlpp.org/) (tested: 0.8 / 0.7) - * [mastodon-cpp](https://schlomp.space/tastytea/mastodon-cpp) (at least: 0.12.0) + * [mastodon-cpp](https://schlomp.space/tastytea/mastodon-cpp) (at least: 0.18.4) * [jsoncpp](https://github.com/open-source-parsers/jsoncpp) (tested: 1.8 / 1.7) ## Get sourcecode diff --git a/src/mastorss.cpp b/src/mastorss.cpp index 15a0e4e..841fc13 100644 --- a/src/mastorss.cpp +++ b/src/mastorss.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include "version.hpp" #include "mastorss.hpp" @@ -57,7 +58,7 @@ int main(int argc, char *argv[]) profile = argv[1]; std::uint16_t ret; string answer; - std::vector entries; + std::vector entries; read_config(instance, access_token, feedurl); curlpp_init(); @@ -76,14 +77,14 @@ int main(int argc, char *argv[]) { // If no last_entry is stored in the config file, // make last_entry the second-newest entry. - last_entry = entries.at(1); + last_entry = entries.at(1).content(); } - config[profile]["last_entry"] = entries.front(); + config[profile]["last_entry"] = entries.front().content(); bool new_content = false; for (auto rit = entries.rbegin(); rit != entries.rend(); ++rit) { - if (!new_content && (*rit).compare(last_entry) == 0) + if (!new_content && (*rit).content().compare(last_entry) == 0) { // If the last entry is found in entries, // start tooting in the next loop. @@ -96,13 +97,9 @@ int main(int argc, char *argv[]) } string answer; - Mastodon::API masto(instance, access_token); + Mastodon::Easy masto(instance, access_token); - API::parametermap parameters = - { - { "status", { *rit } } - }; - ret = masto.post(API::v1::statuses, parameters, answer); + masto.send_post(*rit); if (ret != 0) {