happytodev / blueskyapiwithphp
A PHP Package to interact with Bluesky API
Fund package maintenance!
happytodev
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.9
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- laravel/pint: ^1.0
- pestphp/pest: ^2.20
- spatie/ray: ^1.28
This package is auto-updated.
Last update: 2024-10-28 03:10:06 UTC
README
A package to interact with Bluesky API with PHP.
Support me
I invest a lot of time to create many things for the community. You can sponsor me if you want.
Installation
You can install the package via composer:
composer require happytodev/blueskyapiwithphp
Usage
A little example with Laravel but you can use in plain PHP or with your favorite framework too. It's up to you.
<?php namespace App\Http\Controllers; use Happytodev\Blueskyapiwithphp\Blueskyapiwithphp; class BlueskyController extends Controller { protected $blueskyApi; public function __construct() { $this->blueskyApi = new Blueskyapiwithphp(config('services.bluesky.api_key')); } public function showLikes($handle, $postId) { $likes = $this->blueskyApi->getPostLikes($handle, $postId); return view('likes', compact('likes')); } public function showPostLikesNumber($handle, $postId) { $likesCount = $this->blueskyApi->getPostLikesCount($handle, $postId); $repostsCount = $this->blueskyApi->getPostRepostsCount($handle, $postId); $repliesCount = $this->blueskyApi->getPostRepliesCount($handle, $postId); dd($likesCount, $repostsCount, $repliesCount); } }
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.