shlinkio/shlink-importer
Composer 安装命令:
composer require shlinkio/shlink-importer
包简介
Collection of tools to import links from different sources and map them to a shlink-compliant format
README 文档
README
Collection of tools to import links from different sources and map them to a shlink-compliant format.
Installation
This module can be installed using composer:
composer require shlinkio/shlink-importer
Supported import sources
Bit.ly
It imports using the API v4. The only required param is an access token.
Only the URLs will be imported. Visits/clicks won't be imported yet (See #20).
YOURLS
It imports using YOURLS API. However, since it has some missing capabilities, it requires a dedicated plugin to be installed in YOURLS.
The plugin covers the missing actions in the API, which allow Shlink to list the URLs and all their visits.
It will import short URLs and all their visits, but any information that YOURLS does not track (like the geolocation) cannot be obtained.
Kutt.it
It imports using Kutt API.
It will import short URLs but not their visits, as Kutt.it does not expose individual visits but aggregate information, which is coupled with its UI and uses relative times.
Shlink
It imports from another Shlink instance using the API v2. Useful if you want to migrate to a different host or change the database engine.
You will have to provide the instance's base URL and a valid API key.
It will import short URLs and all their visits. However, it won't be possible to recalculate the location for those visits, so make sure to calculate the locations on the original instance first, by running bin/cli visit:locate --retry.
Standard CSV
It parses a CSV file with the Long URL and Short code columns. It can optionally contain Domain, Title and Tags, being the latter a pipe-separated or comma-separated list of items (foo|bar|baz or foo,bar,baz).
It is also supported that a Short URL column is provided, in which case the Short code and Domain will be inferred from it if not explicitly provided.
Column names can have spaces and have any combination of upper and lowercase.
This method does not allow importing visits due to its one-dimensional nature.
Usage
The module register the short-url:import command, which can be used to import links from different sources.
This command requires the source from which to import to be provided:
`bin/cli short-url:import bitly`
The command will ask you some questions about how to import from this source, and then, once the data is there, it will invoke the Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface service.
Requirements
This package expects some services to be registered as dependencies, as they need to be used by some provided tools.
Shlinkio\Shlink\Importer\ImportedLinksProcessorInterface: It has to resolve an object implementing the interface.Psr\Http\Client\ClientInterface: Required to be able to import from Bit.ly, YOURLS, Kutt.it or another Shlink instance.Psr\Http\Message\RequestFactoryInterface: Required to be able to import from Bit.ly, YOURLS, Kutt.it or another Shlink instance.
shlinkio/shlink-importer 适用场景与选型建议
shlinkio/shlink-importer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 72.74k 次下载、GitHub Stars 达 6, 最近一次更新时间为 2020 年 10 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 shlinkio/shlink-importer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 shlinkio/shlink-importer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 72.74k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 6
- 点击次数: 11
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-21