Giter VIP home page Giter VIP logo

atprotocol's Introduction

AtProtocol

Compliance Supported PHP Version GitHub Sponsors Code Coverage Type Coverage Psalm Level Latest Version on Packagist Downloads

Warning

This project is not finished yet, work in progress.

Installation

You can install the package via composer:

composer require ghostwriter/atprotocol

Usage

Auth

Info

Use app passwords to securely login to Bluesky without giving full access to your account or password. https://bsky.app/settings/app-passwords

$bsky = new Bluesky(personalDataServer: 'https://bsky.social');

// create a new account on the server
$sessionData = $bsky->createAccount(
  email: '[email protected]',
  handle: 'codepoet.bsky.social',
  password: '************'
  inviteCode: 'black-lives-matter',
);

// if an existing session (accessed with 'bsky.session') was securely stored previously, then reuse that
$bsky->resumeSession(session: $sessionData);

// if no old session was available, create a new one by logging in with password (App Password)
$sessionData = $bsky->login(
    identifier: 'codepoet.bsky.social',
    password: '************'
);

$bsky->post(text: 'My first post using ghostwriter/atprotocol for PHP.');

// Feeds and content
$bsky->getTimeline($params,$opts)
$bsky->getAuthorFeed($params,$opts)
$bsky->getPostThread($params,$opts)
$bsky->getPost($params)
$bsky->getPosts($params,$opts)
$bsky->getLikes($params,$opts)
$bsky->getRepostedBy($params,$opts)
$bsky->post($record)
$bsky->deletePost($postUri)
$bsky->like($uri, cid)
$bsky->deleteLike($likeUri)
$bsky->repost($uri, cid)
$bsky->deleteRepost($repostUri)
$bsky->uploadBlob($data,$opts)

// Social graph
$bsky->getFollows($params,$opts)
$bsky->getFollowers($params,$opts)
$bsky->follow($did)
$bsky->deleteFollow($followUri)

// Actors
$bsky->getProfile($params,$opts)
$bsky->upsertProfile($updateFn)
$bsky->getProfiles($params,$opts)
$bsky->getSuggestions($params,$opts)
$bsky->searchActors($params,$opts)
$bsky->mute($did)
$bsky->unmute($did)
$bsky->muteModList($listUri)
$bsky->unmuteModList($listUri)
$bsky->blockModList($listUri)
$bsky->unblockModList($listUri)

// Notifications
$bsky->listNotifications($params,$opts)
$bsky->countUnreadNotifications($params,$opts)
$bsky->updateSeenNotifications()

// Identity
$bsky->resolveHandle($params,$opts)
$bsky->updateHandle($params,$opts)

// Session management
$bsky->createAccount($params)
$bsky->login($params)
$bsky->resumeSession($session)



// Excepions
        // { "name": "InvalidHandle" },
        // { "name": "InvalidPassword" },
        // { "name": "InvalidInviteCode" },
        // { "name": "HandleNotAvailable" },
        // { "name": "UnsupportedDomain" },
        // { "name": "UnresolvableDid" },
        // { "name": "IncompatibleDidDoc" }


// TODO: extract the headers from the lexicon objects

Changelog

Please see CHANGELOG.md for more information on what has changed recently.

Security

If you discover any security-related issues, please use Security Advisories instead of using the issue tracker.

Credits

License

The BSD-3-Clause. Please see License File for more information.

atprotocol's People

Contributors

ghostwriter avatar

Stargazers

 avatar

Watchers

 avatar

atprotocol's Issues

How do I install it?

$ composer require ghostwriter/atprotocol
Installation failed, deleting ./composer.json.

In RequireCommand.php line 225:
                                                                                                                          
  No composer.json present in the current directory (./composer.json), this may be the cause of the following exception.  
                                                                                                                          

In PackageDiscoveryTrait.php line 331:
                                                                                                                                                            
  Could not find a version of package ghostwriter/atprotocol matching your minimum-stability (stable). Require it with an explicit version constraint allo  
  wing its desired stability.                                                                                                                               
                                                                                                                                                            

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-audit] [--audit-format AUDIT-FORMAT] [--update-no-dev] [-w|--update-with-dependencies] [-W|--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--] [<packages>...]

For Usage,
$bsky = new Bluesky(personalDataServer: 'https://bsky.social');
but where in the code is the Bluesky class written?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.