tzfrs/urlextender
最新稳定版本:0.0.2.1
Composer 安装命令:
composer require tzfrs/urlextender
包简介
This library extends short URLs to longURLs using HTTP-Header Location
README 文档
README
This library can be used to expand short URLs such as https://t.co/XdXRudPXH5 and get the URL that is behind the short URL using Guzzles head method and reading the Location header
Install
Install via composer:
{ "require": { "tzfrs/urlextender": "0.0.2.1" } }
Run composer install or composer update.
Getting Started
Note: You can also see the examples.php for more examples.
Basic parsing
<?php require __DIR__ . '/vendor/autoload.php'; $urlExtender = new \tzfrs\URLExtender\URLExtender(); try { print $urlExtender->extendURL('https://t.co/XdXRudPXH5'); // https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3 print $urlExtender->extendURL('https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3'); //https://blog.twitter.com/2013/rich-photo-experience-now-in-embedded-tweets-3 print $urlExtender->extendURL('http://httpstat.us/404'); // URLExtenderException (404) print $urlExtender->extendURL('http://httpstat.us/500'); // URLExtenderException (500) } catch (\tzfrs\URLExtender\Exceptions\URLExtenderException $e) { print $e->getCode() . ': ' . $e->getMessage(); }
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-09-10