This commit is contained in:
tastytea 2018-04-11 16:57:55 +02:00
parent 770116a6ab
commit f1b94d3d84
Signed by: tastytea
GPG Key ID: 59346E0EA35C67E5
3 changed files with 5 additions and 4 deletions

View File

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

View File

@ -40,8 +40,9 @@ const bool read_config()
{ {
json << file.rdbuf(); json << file.rdbuf();
file.close(); file.close();
json >> config;
if (json >> config) if (!config.isObject())
{ {
cerr << "ERROR: couldn't parse config file. Are you sure the JSON is well-formed?\n"; cerr << "ERROR: couldn't parse config file. Are you sure the JSON is well-formed?\n";
return false; return false;

View File

@ -97,8 +97,8 @@ const bool write_statistics(const string &straccount, Easy::Account &account_ent
ss << std::put_time(&now_tm, "%Y-%m-%dT%T"); ss << std::put_time(&now_tm, "%Y-%m-%dT%T");
output = ss.str() + ';'; output = ss.str() + ';';
output += account_entity.statuses_count() + ';'; output += std::to_string(account_entity.statuses_count()) + ';';
output += account_entity.followers_count() + '\n'; output += std::to_string(account_entity.followers_count()) + '\n';
outfile.write(output.c_str(), output.length()); outfile.write(output.c_str(), output.length());
outfile.close(); outfile.close();