AD
Boost Your Brand on BlueSky—Exclusive banner space to amplify your reach within the BlueSky community.
BSkyInfo LogoBskyInfo
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryArticlesGuidesGlossaryBluesky SDKsSponsor
Submit
All ToolsCategoriesCollectionsFeed DirectoryLabeler DirectoryGuidesGlossaryArticlesBluesky SDKsSponsorSubmit
  1. SDKs
  2. /C/C++
  3. /atproto-cpp
lmangani

atproto-cpp

A C/C++ SDK for Bluesky and AT Protocol by lmangani

Simple C++ interface for interacting with BlueSky #atproto

GitHub Stats

3stars
1forks
2contributors
0open issues

Dates

Created:November 2, 2024
Last updated:November 23, 2024

README

The following content is from atproto-cpp's GitHub repository. All rights reserved by the original author.

atproto-cpp

CMake Builder

The BlueSky atproto-cpp library provides a C++ interface for interacting with the BlueSky social networking service. This library includes functions to handle user authentication, post creation, feed retrieval, and more.

Features

  • User authentication and session management
  • Post creation and feed retrieval
  • Helper functions for JSON manipulation and URL encoding

Installation

To use the BlueSky HPP library, include the header files in your project and link against the required dependencies.

#include "bluesky_client.hpp"

Usage

Initialization

To initialize the BlueskyClient, provide the server address:

BlueskyClient client("bsky.social");
Authentication

To log in to the BlueSky service, use the login function:

bool success = client.login("your_identifier", "your_password");
if (success) {
    std::cout << "Logged in successfully!" << std::endl;
} else {
    std::cerr << "Login failed!" << std::endl;
}
Creating a Post

To create a new post, use the createPost function:

BlueskyClient::Error error = client.createPost("Hello, BlueSky!");
if (error == BlueskyClient::Error_None) {
    std::cout << "Post created successfully!" << std::endl;
} else {
    std::cerr << "Failed to create post!" << std::endl;
}
Retrieving Feed Posts

To retrieve posts from a feed, use the getFeedPosts function:

BlueskyClient::PostsResult result = client.getFeedPosts("feed_uri", 10);
if (result.error == BlueskyClient::Error_None) {
    for (const auto& post : result.posts) {
        std::cout << "Post: " << post.text << std::endl;
    }
} else {
    std::cerr << "Failed to retrieve feed posts!" << std::endl;
}
Retrieving Author Posts

To retrieve posts from a specific author, use the getAuthorPosts function:

BlueskyClient::PostsResult result = client.getAuthorPosts("author_id", 10);
if (result.error == BlueskyClient::Error_None) {
    for (const auto& post : result.posts) {
        std::cout << "Author Post: " << post.text << std::endl;
    }
} else {
    std::cerr << "Failed to retrieve author posts!" << std::endl;
}
Additional Functions
  • getUnreadCount(): Retrieves the count of unread notifications.
  • filterText(const std::string& str): Filters special characters from a text string.
  • splitIntoWords(const std::string& str): Splits a string into individual words.
  • urlEncode(const std::string& str): Encodes a string for use in URLs.
  • createJsonString(const std::map<std::string, std::string>& data): Creates a JSON string from a map of key-value pairs.

Status

  • Prototype, Untested

Credits

Contains portions of bluesky_esphom and postbluesky

Topics

atprotoblueskybskycpp

Related SDKs

mfnboeratproto

Qt/C++ ATProto library

2•C/C++
neobrainblobify

C++17 library for all your binary de-/serialization needs

276•C/C++

Resources

GitHub Repository

License

MIT

Author

lmangani
lmangani

Activity

Last commit: November 23, 2024
Commit frequency: Unknown

Our Sponsors

Your Brand Here!

50K+ engaged viewers every month

Limited spots available!

📧 Contact us via email🦋 Contact us on Bluesky
BSkyInfo LogoBskyInfo

The Most Comprehensive Bluesky Tools Directory

Stay updated with the latest Bluesky tools and ecosystem news 🦋

Bluesky butterfly logo
Quick LinksSubmit a ToolSponsorAboutLegal Information
ToolsFeed DirectoryLabeler DirectorySchedulingAnalyticsAll ToolsCategoriesCollectionsTags
ResourcesArticlesBluesky GuidesBluesky GlossaryBluesky SDKsBluesky ResourcesSkyRaffleMeida Coverage
Our ProductsRaffleBlueAiTeach ToolsLaiewAI affiliate listFirsto

This website may contain affiliate links

© 2025 BskyInfo. All rights reserved.