定制 trukes/threads-api-php-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trukes/threads-api-php-client

最新稳定版本:0.0.2

Composer 安装命令:

composer require trukes/threads-api-php-client

包简介

A PHP client library for accessing Threads from Meta

README 文档

README

License PHP Version

A PHP library for seamless integration with the Threads API by Meta. This package provides a simple and intuitive interface for interacting with the API, making it easy to integrate with PHP applications.

Features

  • Publishing: Upload and publish Threads media objects and check their status.
  • Media Retrieval: Retrieve Threads media objects.
  • Reply Management: Retrieve replies and conversations and hide/unhide replies.
  • User: Retrieve a Threads user's posts, publishing limit, and profile.
  • Insights: Retrieve insights for Threads media objects and users.

Coming soon

  • Authentication: Issue - Support for OAuth2 authentication.

Requirements

  • PHP 8.1 or higher

Installation

Installation is done via Composer. Simply run the following command:

composer require trukes/threads-api-php-client

Basic Usage

Client

Before using the API, you need to create a client:

require 'vendor/autoload.php';

use Trukes\ThreadsApiPhpClient\Threads;

$client = Threads::client('<your_token_here>');

Create a Post

$create = $client->publish()->create(
    'threads_user_id',
    'media_type',
    'text',
    'image_url',
    'video_url',
    'is_carousel_item',
    'children',
    'reply_to_id',
    'reply_control',
    'allowlisted_country_codes',
    'all_text',
)->data();

echo 'Post created successfully. Media container ID: ' . $response['id'];

Publish a Post

$create = $client->publish()->publish(
    'threads_user_id',
    '129984213'
)->data();

echo 'Post created successfully. Media container ID: ' . $response['id'];

Threads Documentation

Complete META Threads documentation can be found here.

Package Documentation

Complete documentation can be found here.

Contributing

Contributions are welcome! If you have suggestions, fixes, or improvements, feel free to open an issue or a pull request.

How to Contribute

  1. Fork the repository.
  2. Create a new branch for your feature (git checkout -b feature/new-feature).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature/new-feature).
  5. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

If you have any questions or suggestions, feel free to contact us at pedro.m.a.carmo@gmail.com.

⭐️ Show Your Support

If this project helped you or you find it useful, please give it a star ⭐️ on GitHub. It helps others discover the project and motivates us to continue developing and improving it.

Made with ❤️ by Trukes (https://github.com/Trukes).

统计信息

  • 总下载量: 307
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 9
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-08-30