thcolin/senscritique-api

此包已被 废弃 并不再维护。未建议替代包。
此包的最新版本(dev-master)未提供许可证信息。

dev-master 2017-02-08 09:24 UTC

This package is not auto-updated.

Last update: 2020-01-24 16:09:55 UTC


README

Build Status Code Climate Test Coverage

PHP 库,通过 curl 和 dom 解析调用 SensCritique 网站的基本功能

安装

使用 composer 安装

composer require thcolin/senscritique-api

示例

创建一个新的 Client 对象

use thcolin\SensCritiqueAPI\Client;

$client = new Client();

$user = $client -> getUser('Plug_In_Papa');
$collection = $user -> getCollection();

$movie = $collection[0];
echo $movie -> getTitle();
print_r($movie -> serialize());

$tvshow = $client -> getArtwork(438579);
echo $tvshow -> getStoryline();
print_r($tvshow -> serialize());

$lists = $user -> getLists();
$bestMovies = $lists['bestMovies'];
$movie = $bestMovies[0];

$list = $client -> getList(455329);
$best2016Movie = $list[0];

查看 tests/ClientTests 获取更多信息

  • 美丽的 DynamicArray 类,可以动态加载页面
  • 华丽的 Selection 类,可以异步获取所有页面(更快 ❤️ )

待办事项

  • 实现 Client 方法 searchArtwork,但只有“下一页”可用,没有最新内容
  • API 和其他 Coresrc 类上添加日志(和级别)
  • 添加压力测试(API 可以处理多少 Artwork?)