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.
2018-01-12 20:49:15 +01:00
|
|
|
/* This file is part of mastodon-cpp.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <iostream>
|
2018-01-13 15:49:46 +01:00
|
|
|
#include <cstdint>
|
2018-03-21 23:27:10 +01:00
|
|
|
#include "mastodon-cpp.hpp"
|
2018-01-12 20:49:15 +01:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
Mastodon::API test("soc.ialis.me", "");
|
2018-01-13 15:49:46 +01:00
|
|
|
std::string answer;
|
|
|
|
std::uint16_t ret = test.get(Mastodon::API::v1::instance, answer);
|
|
|
|
if (ret == 0)
|
2018-01-12 20:49:15 +01:00
|
|
|
{
|
2018-01-13 15:49:46 +01:00
|
|
|
if (answer.substr(7, 14) == "\"soc.ialis.me\"")
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2018-01-12 20:49:15 +01:00
|
|
|
}
|
2018-01-13 15:49:46 +01:00
|
|
|
|
|
|
|
std::cout << ret << ": " << answer.substr(7, 14) << '\n';
|
|
|
|
return 1;
|
2018-01-12 20:49:15 +01:00
|
|
|
}
|