tongyifan/doubanphp
Composer 安装命令:
composer require tongyifan/doubanphp
包简介
Library for parsing metadata information about movies and TV shows from Douban Movie
README 文档
README
Library for parsing metadata information about movies and TV shows from Douban Movie. This library use data api from Rhilip/pt-gen-cfworker, cache included.
-
Setup your own pt-gen on Cloudflare worker See Rhilip/pt-gen-cfworker. Then change
api_endpointinconf/config.inito your own cfworker. -
Requirements
- PHP >= 5.6
- PHP cURL extension
- PHP JSON extension
- Install
composer install tongyifan/doubanphp
- Usage
<?php require 'vendor/autoload.php'; use Douban\Douban; $douban_id = '30458442'; $douban = new Douban($douban_id); $douban_rating = $douban->douban_rating;
- Advanced usage
- You can change cache settings by changing
conf/config.ini. - Or change it in your application.
<?php require 'vendor/autoload.php'; use Douban\Douban; use Douban\Config; $config = new Config(); // see https://book.cakephp.org/3/en/core-libraries/caching.html for more information. $config->cache_config = [ 'className' => 'Redis', 'duration' => '+14 days', 'prefix' => 'doubanphp_', 'host' => '127.0.0.1', 'port' => 6379 ]; $imdb_id = 'tt11043632'; $douban = new Douban($imdb_id, null, $config); $douban_rating = $douban->douban_rating; // or use numeric IMDb id, but you should add "source". $imdb_id = '11043632'; $douban = new Douban($imdb_id, 'imdb', $config); $douban_rating = $douban->douban_rating;
统计信息
- 总下载量: 297
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-22