An open API service indexing awesome lists of open source software.

https://github.com/ahmard/reactphp-querylist

This library brought ReactPHP and QueryList together
https://github.com/ahmard/reactphp-querylist

php-async php-async-scrapper php-scraper querylist reactphp reactphp-http

Last synced: about 1 month ago
JSON representation

This library brought ReactPHP and QueryList together

Awesome Lists containing this project

README

        

# ReactPHP QueryList

This library brought [ReactPHP](https://github.com/reactphp/http) and [QueryList](https://github.com/jae-jae/QueryList)
together.

## Installation

```
composer require ahmard/reactphp-querylist
```

## Usage

- Playing with **QueryList**(scraping)
```php
use ReactphpQuerylist\Client;
use ReactphpQuerylist\Queryable;

require 'vendor/autoload.php';

Client::get('https://google.com')
->then(function (Queryable $queryable){
$title = $queryable->queryList()->find('head title')->text();
var_dump($title);
})
->otherwise(function ($error){
echo $error;
});
```

- Working with response object
```php
use ReactphpQuerylist\Client;
use ReactphpQuerylist\Queryable;

require 'vendor/autoload.php';

Client::get('https://google.com')
->then(function (Queryable $queryable){
var_dump($queryable->response()->getReasonPhrase());
})
->otherwise(function ($error){
echo $error;
});
```