mastodon-cpp
0.110.0
|
Child of Mastodon::API with abstract methods. More...
#include <easy.hpp>
Public Member Functions | |
API (const string &instance, const string &access_token) | |
Constructs a new Easy object. More... | |
const Link | get_link () const |
Gets the links from the last answer. More... | |
const return_entity< Easy::Status > | send_post (const Status &status) |
Sends a post. More... | |
const return_entity< Easy::Status > | send_toot (const Status &status) |
Alias for send_post() More... | |
const return_entity_vector< Easy::Notification > | get_notifications (const uint16_t limit=20, const string since_id="", const string max_id="") |
Gets notifications. More... | |
![]() | |
API (const string &instance, const string &access_token) | |
Constructs a new API object. More... | |
virtual | ~API () |
Destroys the object. More... | |
void | set_useragent (const string &useragent) |
Sets the useragent. Default is mastodon-cpp/version. More... | |
const string | get_useragent () const |
Gets the useragent. More... | |
const string | get_instance () const |
Returns the instance. More... | |
return_call | register_app1 (const string &client_name, const string &redirect_uri, const string &scopes, const string &website, string &client_id, string &client_secret, string &url) |
Register application, step 1/2. More... | |
return_call | register_app2 (const string &client_id, const string &client_secret, const string &redirect_uri, const string &code, string &access_token) |
Register application, step 2/2. More... | |
const string | get_header (const string &header) const |
Gets the header from the last answer. More... | |
bool | exceptions (const bool &value) |
Turn exceptions on or off. Defaults to off. More... | |
bool | exceptions () const |
Returns true if exceptions are turned on, false otherwise. | |
void | set_proxy (const string &hostport, const string &userpw="") |
Sets the proxy. More... | |
const return_call | get (const Mastodon::API::v1 &call) |
Make a GET request that doesn't require parameters. More... | |
const return_call | get (const Mastodon::API::v1 &call, const parameters ¶meters) |
Make a GET request that requires parameters. More... | |
const return_call | get (const Mastodon::API::v2 &call, const parameters ¶meters) |
Make a GET request that requires parameters. More... | |
const return_call | get (const string &call) |
Make a custom GET request. More... | |
void | get_stream (const Mastodon::API::v1 &call, const parameters ¶meters, unique_ptr< Mastodon::API::http > &ptr, string &stream) |
Make a streaming GET request. More... | |
void | get_stream (const Mastodon::API::v1 &call, unique_ptr< Mastodon::API::http > &ptr, string &stream) |
Make a streaming GET request. More... | |
void | get_stream (const string &call, unique_ptr< Mastodon::API::http > &ptr, string &stream) |
Make a streaming GET request. More... | |
return_call | patch (const Mastodon::API::v1 &call, const parameters ¶meters) |
Make a PATCH request. More... | |
return_call | post (const Mastodon::API::v1 &call) |
Make a POST request that doesn't require parameters. More... | |
return_call | post (const Mastodon::API::v1 &call, const parameters ¶meters) |
Make a POST request that requires parameters. More... | |
return_call | post (const string &call, const parameters ¶meters) |
Make a custom POST request. More... | |
return_call | put (const Mastodon::API::v1 &call, const parameters ¶meters) |
Make a PUT request that requires parameters. More... | |
return_call | put (const string &call, const parameters ¶meters) |
Make a custom PUT request. More... | |
return_call | del (const Mastodon::API::v1 &call, const parameters ¶meters) |
Make a DELETE request that requires parameters. More... | |
return_call | del (const string &call, const parameters ¶meters) |
Make a custom DELETE request. More... | |
Additional Inherited Members | |
![]() | |
enum | v1 { accounts_id, accounts, accounts_verify_credentials, accounts_update_credentials, accounts_id_followers, accounts_id_following, accounts_id_statuses, accounts_id_follow, accounts_id_unfollow, accounts_relationships, accounts_search, apps, apps_verify_credentials, blocks, accounts_id_block, accounts_id_unblock, custom_emojis, domain_blocks, endorsements, accounts_id_pin, accounts_id_unpin, favourites, statuses_id_favourite, statuses_id_unfavourite, filters, filters_id, follow_requests, follow_requests_id_authorize, follow_requests_id_reject, suggestions, suggestions_accountid, instance, lists, accounts_id_lists, lists_id_accounts, lists_id, media, media_id, mutes, accounts_id_mute, accounts_id_unmute, statuses_id_mute, statuses_id_unmute, notifications, notifications_id, notifications_clear, notifications_dismiss, push_subscription, polls_id, polls_id_votes, reports, statuses_id, statuses_id_context, statuses_id_card, statuses_id_reblogged_by, statuses_id_favourited_by, statuses, statuses_id_reblog, statuses_id_unreblog, statuses_id_pin, statuses_id_unpin, timelines_home, conversations, timelines_public, timelines_tag_hashtag, timelines_list_list_id, streaming_health, streaming_user, streaming_public, streaming_public_local, streaming_hashtag, streaming_hashtag_local, streaming_list, streaming_direct, bookmarks, statuses_id_bookmark, statuses_id_unbookmark } |
A list of all v1 API calls. More... | |
enum | v2 { search } |
A list of all v2 API calls. More... | |
![]() | |
static const string | urlencode (const string &str) |
Alias for Mastodon::urlencode. More... | |
static const string | urldecode (const string &str) |
Alias for Mastodon::urldecode. More... | |
static const string | unescape_html (const string &html) |
Alias for Mastodon::unescape_html. More... | |
Child of Mastodon::API with abstract methods.
Provides convenient functions to deal with the responses you get.
|
explicit |
Constructs a new Easy object.
To register your application, leave access_token blank and call register_app1() and register_app2().
instance | The hostname of your instance |
access_token | The access token |
const Easy::Link Easy::API::get_link | ( | ) | const |
Gets the links from the last answer.
const return_entity_vector< Notification > API::get_notifications | ( | const uint16_t | limit = 20 , |
const string | since_id = "" , |
||
const string | max_id = "" |
||
) |
Gets notifications.
limit | Maximum number of notifications |
since_id | Return notifications newer than ID |
max_id | Return notifications older than ID |
const return_entity< Status > API::send_post | ( | const Status & | status | ) |
Sends a post.
status | The status to send |
const return_entity< Status > API::send_toot | ( | const Status & | status | ) |
Alias for send_post()