vorapoap/coinmarketcap
Composer 安装命令:
composer require vorapoap/coinmarketcap
包简介
Access Coinmarketcap.com via local database wrapper
README 文档
README
Store and retreive Coinmarketcap's data from local database
Install using composer
Create composer.json file
{
"name": "yourproject/yourproject",
"type": "project",
"require": {
"vorapoap/coinmarketcap": "*"
}
}
and run composer update or run this command in your command line:
composer require voapoap/coinmarketcap
1. Define options
- Use existing PDO connection
$options['pdo'] = $existingPDOConnection;
- Use new connection
$options['host'] = 'localhost'; $options['database'] = 'coinmarketcap'; $options['user'] = 'user'; $options['password'] = 'password';
2. Create object
$coin = new Coinmarketcap($options);
On object constructing, the table will be checked for existence. If the table doesn't exist, the required table coinmarketcap is created, you can also define $options['prefix'] to prefix the table.
Other options
| Name | Description |
|---|---|
| prefix | Table prefix, default is none |
| coinmarketcap-limit | Default is 100 (See [https://coinmarketcap.com/api/]) |
| coinmarketcap-update-interval | Update interval, default is 60s |
3. Usage
You can also do $coin->update(150) to override default coin limit
$coin = new Coinmarketcap($options); $coin->update(); $coin->getCoin("btc"); $coin->getCoin("bitcoin");
Automtically retrieve data from Coinmarketcap base on update interval.
$coin = new Coinmarketcap($options); $coin->getCoin("btc");
4. Donation
If you like this work and like to donate:
- BTC: 13SsoAUNv1KobhnDSZytLo71NHAGu9XxUd
- ETH: 0x1E0d07890Cb550F18eE6B80dC5739CFe776C72b5
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-11