thcolin / senscritique-api
此包已被 废弃 并不再维护。未建议替代包。
此包的最新版本(dev-master)未提供许可证信息。
dev-master
2017-02-08 09:24 UTC
Requires
- imangazaliev/didom: ~1.5
- jyggen/curl: ~3.0
Requires (Dev)
- codeclimate/php-test-reporter: ^0.4.3
This package is not auto-updated.
Last update: 2020-01-24 16:09:55 UTC
README
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和其他Core或src类上添加日志(和级别) - 添加压力测试(API 可以处理多少
Artwork?)