mp-php / fuel-packages-bitly
dev-master
2013-05-04 07:46 UTC
Requires
This package is auto-updated.
Last update: 2024-09-19 20:32:02 UTC
README
安装
设置到 fuel/packages/bitly
- 使用 composer https://packagist.org.cn/packages/mp-php/fuel-packages-bitly
- git submodule add
- 下载 zip
使用方法
1: 配置
- 获取登录 & apikey http://bitly.com/a/your_api_key
- 将 packages/bitly/config/bitly.php 复制到 app/config 目录下。
- 编辑复制的 bitly.php 文件。
2: 启用 bitly 包。
在 app/config/config.php 中
'always_load' => array('packages' => array(
'bitly',
...
或者
在你的代码中
Package::load('bitly');
支持的 API
/v3/expand
Bitly::expand('http://bit.ly/MiCtW6'); // 'http://google.com/'
/v3/shorten
Bitly::shorten('http://google.com/') // 'http://bit.ly/MiCtW6'