baraja-core / wayback
该包最新版本(v1.0.2)没有可用的许可信息。
简单的wayback界面。
v1.0.2
2022-09-12 07:35 UTC
Requires
- php: ^8.0
- nette/caching: ^3.1
- nette/http: ^3.0
- nette/utils: ^3.0
Requires (Dev)
- phpstan/extension-installer: ^1.1
- phpstan/phpstan: ^1.0
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-nette: ^1.0
- phpstan/phpstan-strict-rules: ^1.0
- roave/security-advisories: dev-master
- spaze/phpstan-disallowed-calls: ^2.0
This package is auto-updated.
Last update: 2024-09-12 11:40:40 UTC
README
archive.org的简单wayback界面。
📦 安装与基本用法
要安装此包,请调用Composer并执行以下命令
$ composer require baraja-core/wayback
无需配置,包将自动处理依赖项。不需要DIC的使用。缓存将自动存储在文件系统中。
如何使用
简单创建Wayback实例并调用方法
$wayback = new Wayback; // Return list of available archives by host $wayback->getArchivedUrlsByHost('baraja.cz'); // Return list of available archives by URL (http/https and www will be ignored) $wayback->getArchivedUrls('https://php.baraja.cz/navody'); // Return list of crawled subdomains (for large sites can not be complete) $wayback->getSubdomains('baraja.cz'); // Save now given URL to Wayback $wayback->saveUrl('https://baraja.cz'); // Find nearest archived datetime $wayback->getClosedArchivedDateTime('https://baraja.cz/robots.txt', new \DateTime('2020-09-04')); // Find and download nearest archived file $wayback->getClosedArchivedFile('https://baraja.cz/robots.txt', new \DateTime('2020-09-04')); // Download specific file by wayback link $wayback->getArchivedFile('http://web.archive.org/web/20200923184117/https://baraja.cz/robots.txt');
所有来自Wayback Machine的结果的返回都受缓存影响。结果将自动缓存到您的文件系统中。
DateTime
DateTime以Wayback格式(字符串)存储。Wayback将日期存储在UTC时区。此包将自动转换datetime。
示例:日期 20050101143010
对应 2005-01-01 14:30:10
。
📄 许可证
baraja-core/wayback
遵循MIT许可证。有关更多详细信息,请参阅LICENSE文件。