This repository has been archived on 2020-05-10. You can view files and clone it, but cannot push or open issues or pull requests.
mastodon-cpp/tests/test_02_easy_get_public_timeline.cpp

28 lines
627 B
C++
Raw Normal View History

2018-04-01 05:03:50 +02:00
/* This file is part of mastodon-cpp.
*/
#include <iostream>
#include <cstdint>
#include "mastodon-cpp.hpp"
#include "easy/easy.hpp"
2018-04-03 00:13:21 +02:00
#include "easy/entities/status.hpp"
2018-04-01 05:03:50 +02:00
int main(int argc, char *argv[])
{
Mastodon::Easy test("botsin.space", "");
std::string answer;
std::uint16_t ret = test.get(Mastodon::API::v1::timelines_public,
{ { "limit", { "1" } } }, answer);
if (ret == 0)
{
Mastodon::Easy::Status status(answer);
if (status.valid())
{
return 0;
}
}
std::cout << ret << ": " << answer << '\n';
return 1;
}