diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 660c7cb..0000000 --- a/docs/index.html +++ /dev/null @@ -1,253 +0,0 @@ - - - - - - - -mastodon-cpp: Main Page - - - - - - -
-
- - - - - - -
-
mastodon-cpp -  0.15.1 -
-
-
- - - - - - -
-
-
-
mastodon-cpp Documentation
-
-
-

mastodon-cpp is a C++ wrapper for the Mastodon API. The library takes care of the network stuff. You submit a query and get the raw JSON. You can then put that JSON into easy to use classes.

-

TODO-list

-

Usage

-

The HTML reference can be generated with build_doc.sh, if doxygen is installed. It is also available at tastytea.github.io/mastodon-cpp/. There are examples in examples/.

-

Upgrading from below 0.13.0

- -

Upgrading from below 0.10.0

-

Mastodon::API::get, ::get_stream, ::post, ::put and ::del don't take std::string as parameter to API-calls anymore, only parametermaps. The old behaviour is still supported but is deprecated and will be removed in version 1.0.0.

-

Upgrading from below 0.7.0

-

Your projects will break, sorry. Here are the important changes:

- -

Most basic example

-
{C++}
#include <iostream>
#include <string>
#include <mastodon-cpp/mastodon-cpp.hpp>
int main()
{
Mastodon::API masto("social.example.com", "auth_token");
std::string answer;
masto.get(Mastodon::API::v1::accounts_verify_credentials, answer);
std::cout << answer << '\n';
}

Another simple example

-

Using the Easy-class.

-
{C++}
#include <iostream>
#include <string>
#include <vector>
#include <mastodon-cpp/mastodon-cpp.hpp>
#include <mastodon-cpp/easy/all.hpp>
using Mastodon::Easy;
int main()
{
Easy masto("social.example", "");
std::string answer;
masto.get(Mastodon::API::v1::timelines_public, answer);
for (const std::string &str : Easy::json_array_to_vector(answer))
{
Easy::Status status(str);
std::cout << " " << status.account().acct() << " wrote:\n";
std::cout << status.content() << '\n';
}
}

Compiling your project

-

A project consisting of one file can be compiled as follows:

g++ -std=c++14 -lmastodon-cpp example.cpp
-

Error codes

-

mastodon-cpp will never use error codes below 11, except 0.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Code Explanation
0 No error
11 Invalid call
12 Not implemented
13 URL changed (HTTP 301 or 308)
14 Aborted by user
15 Network error (curlpp exception)
~~20~~ ~~Failed to connect~~
~~21~~ ~~Couldn't resolve host~~
~~22~~ ~~Network is unreachable~~
~~23~~ ~~Transfer interrupted~~
~~24~~ ~~SSL error~~
~~25~~ ~~Timeout~~
100 - 999 HTTP status codes
65535 Unknown error
-

If you use a debug build, you get more verbose error messages. Errors 20-25 are no longer in use (since 0.8.9).

-

Useful links

- -

Install

-

Packages

-

Every release includes packages for the package managers of Gentoo, Debian and Red Hat.

-

Gentoo

-

Put the ebuild into your local overlay and run ebuild <ebuild path> manifest. Install with emerge mastodon-cpp.

-

Or add my repository and install it from there.

eselect repository add tastytea git https://git.tastytea.de/repos/overlay-tastytea.git
-echo 'dev-cpp/mastodon-cpp ~amd64' >> /etc/portage/package.keywords/mastodon-cpp
-emaint sync -r tastytea
-emerge -a dev-cpp/mastodon-cpp
-

DEB and RPM

-

Prebuilt DEB and RPM packages for x86_64(amd64) are provided with each release. These packages are automatically built and not tested. Install with dpkg -i or rpm -i, respectively.

-

To use the DEB package on stretch, you will need libcurlpp0 from buster or jessie.

-

From source

-

Dependencies

- -

Get sourcecode

-

Release

-

Download the current release at GitHub.

-

Development version

-

git clone https://schlomp.space/tastytea/mastodon-cpp.git
-

Compile

-
mkdir build
-cd build/
-cmake ..
-make
-

cmake options:

- -

You can run the tests with ctest .. inside the build directory. To install, run make install.

-

Packages

-

Gentoo

-

Put the ebuild from packages/gentoo into your local overlay and rename it to match the desired version or use the live-ebuild (mastodon-cpp-9999.ebuild) to install the development version.

-

DEB and RPM

-

Compile with -DWITH_DEB=ON or -DWITH_RPM=ON. Run make package from the build directory to generate a DEB/RPM package.

-

Other

-

Run make package from the build directory to generate a tar.gz archive.

-

Status of implementation

-

Feature complete as of Mastodon 2.4.0

- -

Copyright

-
Copyright © 2018 tastytea <tastytea@tastytea.de>.
-License GPLv3: GNU GPL version 3 <https://www.gnu.org/licenses/gpl-3.0.html>.
-This program comes with ABSOLUTELY NO WARRANTY. This is free software,
-and you are welcome to redistribute it under certain conditions.
- - - -