承接 amirho3ein-hn/comickioapi 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

amirho3ein-hn/comickioapi

Composer 安装命令:

composer require amirho3ein-hn/comickioapi

包简介

A library for interacting with Comick.io

README 文档

README

This is a PHP class for interacting with the Comick.io website's API. It provides a variety of methods for retrieving comic data such as comic titles, chapters, cover images, and more. The class allows you to easily fetch data related to specific comics from the Comick.io platform, download chapters, and manage comic-related content.

Table of Contents

  1. Installation
  2. Requirements
  3. Methods
  4. Usage Example
  5. Contributing
  6. License

Installation

To use this class, you need to include it in your PHP project. You can either download the ComickIo.php file or clone this repository into your project.

git clone https://github.com/amirho3ein-hn/ComickIoAPI.git
composer require amirho3ein-hn/ComickIoAPI

Requirements

  • PHP 7.4 or higher
  • cURL enabled in PHP

Methods

getComicData(string $comicUrl = "https://comick.io/comic/example-comic")

This method returns the entire comic information by fetching the data from the provided comic URL.

Example:

$comic = new ComickIo();
$data = $comic->getComicData("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicId(string $comicUrl = null)

This method returns the ID of the comic by fetching data from the provided comic URL.

Example:

$comic = new ComickIo();
$data = $comic->getComicId("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicCountry(string $comicUrl = null)

Fetches the country of origin for the comic.

Example:

$comic = new ComickIo();
$data = $comic->getComicCountry("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicLastChapter(string $comicUrl = null)

Returns the last chapter number of the comic.

Example:

$comic = new ComickIo();
$data = $comic->getComicLastChapter("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicCoverLink(string $comicUrl = null)

Returns the URL for the comic's cover image.

Example:

$comic = new ComickIo();
$data = $comic->getComicCoverLink("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicSlug(string $comicUrl = null)

Gets the "slug" (unique identifier) of the comic.

Example:

$comic = new ComickIo();
$data = $comic->getComicSlug("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicTitle(string $comicUrl = null)

Returns the title of the comic.

Example:

$comic = new ComickIo();
$data = $comic->getComicTitle("https://comick.io/comic/example-comic");
echo json_encode($data);

getComicChapters(string $comicUrl = null, string $lang = null, int $chapter = null)

Fetches the list of chapters for a comic, optionally filtered by language and chapter number.

Example:

$comic = new ComickIo();
$data = $comic->getComicChapters("https://comick.io/comic/example-comic", "en");
print_r($chapters);

getComicChapter(string $comicUrl, string $hid, string $lang, int $chapter)

Returns data for a specific comic chapter, including images and other details.

Example:

$comic = new ComickIo();
$data = $comic->getComicChapter("https://comick.io/comic/example-comic", "hid123", "en", 1);
print_r($chapterData);

downloadComicChapter(string $comicUrl, string $hid, string $lang, int $chapter, string $outputDir = 'downloadChapter')

Downloads the comic chapter and stores the images in a ZIP file.

Example:

$comic = new ComickIo();
$data = $comic->downloadComicChapter("https://comick.io/comic/example-comic", "hid123", "en", 1);
print_r($download);

Usage Example

Below is a full usage example showing how to use multiple methods of the class:

// Include the class
require_once 'ComickIo.php';

// Create an instance of the class
$comic = new ComickIo();

// Fetch comic details
$comicUrl = "https://comick.io/comic/example-comic";

// Get comic ID
$comicId = $comic->getComicId($comicUrl)['comicid'];
echo "Comic ID: $comicId
";

// Get the country of the comic
$country = $comic->getComicCountry($comicUrl)['country'];
echo "Country: $country
";

// Get the last chapter
$lastChapter = $comic->getComicLastChapter($comicUrl)['last_chapter'];
echo "Last Chapter: $lastChapter
";

// Get comic cover image URL
$coverLink = $comic->getComicCoverLink($comicUrl)['cover'];
echo "Cover Link: $coverLink
";

// Get comic title
$title = $comic->getComicTitle($comicUrl)['title'];
echo "Title: $title
";

// Get list of chapters
$chapters = $comic->getComicChapters($comicUrl)['chapters'];
echo "Chapters: 
";
print_r($chapters);

Contributing

Feel free to fork this repository, submit issues, and create pull requests. All contributions are welcome!

License

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

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-10