fireguard / url-shortener
URL 短链接。
v0.1.0
2017-05-18 21:18 UTC
Requires
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- phpunit/phpunit: ^6.1
- vlucas/phpdotenv: ^2.4
This package is not auto-updated.
Last update: 2024-09-15 02:02:50 UTC
README
安装
该包可以通过 composer 安装。
为了将包自动添加到您的 composer.json 文件中,运行以下命令
composer require fireguard/url-shortener
或者,如果您愿意,可以手动添加以下片段
{
"require": {
...
"fireguard/url-shortener": "^0.1"
}
}
用法
使用的基本说明。
Google URL Shortener
生成 Google API 密钥
https://developers.google.com/console/help/generating-dev-keys
$google = new GoogleUrlShortener('YOUR_GOOGLE_KEY'); $url = $google->shorten('https://google.com.br/');
ToLy URL Shortener
$toLy = new Fireguard\UrlShortener\ToLyUrlShortener(); $url = $toLy->shorten('https://google.com.br/');