Skip to content

ignatisD/crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crawler - A quick-start helper to website crawling

Installation

Install the latest version with

$ composer require iggi/crawler

Basic Usage

<?php
require_once "vendor/autoload.php";

use Iggi\Crawler;

class MyCrawler extends Crawler {

    protected $uri = "https://ignatisd.gr";

    public function __construct($proxy = null, $debug = 0)
    {
        parent::__construct($proxy, $debug);
    }

    public function hello() {
        $response = $this->curlRequest->get($this->getUrl("/hello"))->exec();
        if ($response->code === 200) {
            return json_decode($response->body, true);
        }
        return $this->errorHandler("Request failed");
    }
}


$crawler = new MyCrawler();
$result = $crawler->hello();

print_r($result);
/*
array(
    "success" => true,
    "message" => "Hello world!"
)
*/

Author

Ignatios Drakoulas - ignatisnb@gmail.com - https://twitter.com/ignatisd

License

Crawler is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages