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/src/example/example.cpp

30 lines
563 B
C++

/* This file is part of mastodon-cpp.
*/
#include <iostream>
#include <vector>
#include <string>
#include "../mastodon-cpp.hpp"
using Mastodon::API;
int main(int argc, char *argv[])
{
if (argc < 3)
{
std::cerr << "usage: " << argv[0] << " <instance> <access token>\n";
return 1;
}
Mastodon::API masto(argv[1], argv[2]);
std::vector<std::string> parameters =
{
"limit=2",
"only_media=1"
};
std::cout <<
masto.get(API::v1::accounts_id_statuses, "44897", parameters) <<
'\n';
}