Download the PHP package glook/apist without Composer

On this page you can find all versions of the php package glook/apist. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apist

Glook Apist

Latest Stable Version Total Downloads Tests

Fork of sleeping-owl/apist with updated dependencies.

Glook Apist is a small library which allows you to access any site in api-like style, based on html parsing.

Install the Package

From Packagist:

Usage

Basic example

Create a class that extends Apist and define your API methods using blueprints — arrays that map keys to CSS selectors with extraction chains:

Result:

Blueprint concept

A blueprint is an array (or a single selector) that describes how to extract structured data from HTML. Each value in the blueprint is an ApistSelector — a chain of CSS selector + extraction methods.

Static helpers

HTTP methods

All standard HTTP methods are supported:

The $options array is passed directly to Guzzle's request options.

Filter methods

Extraction methods available in selector chains:

Method Description
text() Get text content
html() Get inner HTML
attr('name') Get attribute value
hasAttr('name') Check if attribute exists
exists() Check if element exists

Navigation:

Method Description
first() First matched element
last() Last matched element
eq($index) Element at index
next() Next sibling
prev() Previous sibling
children() Child elements
closest($selector) Closest ancestor matching selector

Iteration:

Method Description
each($blueprint) Iterate over matched elements
each() Returns collection for chaining

Transformation:

Method Description
call($callback) Apply custom callback
check($condition, $then) Conditional logic
then($blueprint) Apply blueprint if truthy
trim() Trim whitespace
intval() Cast to integer
floatval() Cast to float
str_replace($search, $replace) String replacement
mb_substr($start, $length) Multibyte substring

Any global PHP function can also be used in the chain (e.g., strtoupper, strip_tags).

Error handling

By default, HTTP errors are suppressed and returned as structured error responses:

Access to Guzzle response

After a request, you can access the underlying Guzzle response:

Testing

Supported PHP Versions

That package has been tested on the following PHP versions:

Copyright and License

Originally written by Sleeping Owl and released under the MIT License.

Fork maintained by Andrey Polyakov.

See the LICENSE file for details.


All versions of apist with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
guzzlehttp/guzzle Version ^7.10.0
symfony/css-selector Version ^5.4.45
symfony/dom-crawler Version ^5.4.48
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package glook/apist contains the following files

Loading the files please wait ...