Giter Site home page Giter Site logo

tra-crawler's Introduction

Logo

TRA Crawler

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

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

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

Create an index.php file at the root of the project and add the following codes:

    <?php

    use Ronnie\TRA\Crawler;

    require_once __DIR__ . '/vendor/autoload.php';

    $url = $_GET['url'] ?? null;
    $code = $_GET['code'] ?? null;
    $time = $_GET['time'] ?? null;

    $crawler = new Crawler();

    if (!is_null($url)) {
        dump($crawler->setUri($url)->crawl());
    } elseif (!is_null($code) && !is_null($time)) {
        dump($crawler->setCode($code, $time)->crawl());
    } else {
        echo "No url given";
    }

Feel free to change the file according to your needs. Then just run the index.php in a web server.

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.

tra-crawler's People

Contributors

ronnietaz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.