Compare commits

...

1 Commits

Author SHA1 Message Date
tastytea 2dcd6908d8
finish support for CW as title
the build is pending Details
2018-08-25 14:29:13 +02:00
3 changed files with 9 additions and 12 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project (mastorss
VERSION 0.6.3
VERSION 0.7.0
LANGUAGES CXX
)

View File

@ -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

View File

@ -23,6 +23,7 @@
#include <chrono>
#include <jsoncpp/json/json.h>
#include <mastodon-cpp/mastodon-cpp.hpp>
#include <mastodon-cpp/easy/all.hpp>
#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<string> entries;
std::vector<Mastodon::Easy::Status> 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)
{