ronnie/tra-crawler 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ronnie/tra-crawler

最新稳定版本:v1.0.0-beta.2

Composer 安装命令:

composer require ronnie/tra-crawler

包简介

A package to crawl TRA web receipts and return the data in necessary format

README 文档

README

Logo

TRA Crawler

A PHP package for crawling TRA receipts and returning its data as a collection, array or json.

Badges

Add badges from somewhere like: shields.io

MIT License

Installation

Install TRA crawler with composer.

  composer require ronnie/tra-crawler

The project also make use of puppeteer to access JS content on the receipt.

  npm install puppeteer

Authors

Usage/Examples

Plain PHP

When using this package in plain PHP, a simple setup like this can help you get started:

  use Ronnie\TRA\Crawler;
  
  ...
  
  $crawler = new Crawler();
  // For URI or QR Scanned receipts you can use the URI method
  $receipt = $crawler->setUri($yourURI)->crawl();

  // For Physical receipt, Receipt verification code and the time is to be used in conjuction with the code method
  $receipt = $crawler->setCode($yourCode, $yourTime)->crawl();

Do note that the time ($yourTime) should be in hhMMss format (124453).

Laravel / Dependency Injection

When using this package in a Laravel/Symfony Project or any project that has a DI container, a better solution would be to use the container to inject an instance of the Ronnie\TRA\Crawler class into whatever class or method you need. A singleton works best for such scenarios.

It is also possible to extend the Ronnie\TRA\Crawler class or write your own implementation as long as they obey the Ronnie\TRA\Contracts\ResourceCrawler contract/interface.

Run Locally

Clone the project

  git clone https://github.com/RonnieTaz/tra-crawler

Go to the project directory

  cd tra-crawler

Install NPM dependencies

  npm install puppeteer

Install Composer dependencies

  composer install

Use CLI app to test output

  php bin/console app:test-output -i url -u the_receipt_url

Also, few sample receipts have been added to the project to simplify testing. Head over to config.php to set which sample you want to use.

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • 开发语言: HTML

其他信息

  • 授权协议: proprietary
  • 更新时间: 2022-10-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固