require './vendor/autoload.php';
use \potibm\Bluesky\BlueskyApi;
use \potibm\Bluesky\BlueskyPostService;
use \potibm\Bluesky\Feed\Post;
$filelist = file('./list.txt');
$bsky_post = $filelist[0];
define('USER_NAME', 'Blueskyのアカウント名');
define('APP_PASSWORD', '取得したアプリパスワード');
private $postService = null;
public function __construct() {
$this->api = new BlueskyApi(USER_NAME, APP_PASSWORD);
$this->postService = new BlueskyPostService($this->api);
public function post($text) {
$post = Post::create($text);
$response = $this->api->createRecord($post);
$status = (new bluesky)->post($bsky_post);
} catch (\Throwable $error) {
//echo "[{$error->getCode()}] {$error->getMessage()}";