Download the PHP package gidlov/copycat without Composer

On this page you can find all versions of the php package gidlov/copycat. 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 copycat

Copycat - A PHP Scraping Class

Latest Stable Version Total Downloads Monthly Downloads Reference Status

You may find more info on gidlov.com/en/code/copycat

For Laravel 5/4 Developers

In the require key of composer.json file add the following:

Run the Composer update command.

For Laravel 5 Developers

Add to providers in app/config/app.php.

and to aliases in the same file.

For Laravel 4 Developers

Add to providers in app/config/app.php.

and to aliases in the same file.

Yet another scraping class

I didn’t do much research before I wrote this class, so there is probably something similar out there, and certainly some more decent solution. A Python version of this class is under development.

But still, I needed a class that could pick out selected pieces from a web page, with regular expression, show or save it. I also needed to be able to save files and or pictures, and also specify or complete a current file name.

It is also possible to use a search engine to look up an address to extract data from. Assuming you has entered an expression for that particular page.

Briefly

How to use this class

Include the class and initiate your object with some custom cURL parameters, if you need/like.

I use IMDb as our target source in these examples.

Say we want to retrieve a particular film score, for simplicity, we happen to know the address of this very film, Donnie Darko. This is how the code could look like.

It’s basically everything. We specify what has to be matched, and a name for this, and we enter an address. Our answer array will look as follows:

If we were to give the method URLs() an associative array instead of a string array('Donnie Darko' => 'http://imdb.com/title/tt0246578/') the answer would be:

Also note that I’m using method chaining, it is supported, but it’s a matter of taste.

But it’s unlikely that we know or can guess IMDb’s choice of URL for a particular movie, so we’ll Binging it when we don’t know it (Google tends to interrupt the sequence after an unknown number of inquiries, therefore I chose Bing).

Now we have introduced fillURLs() which consists of a search query, a regular expression to match our destination page and keywords that represent the search. The result is the same as in the first example.

Let’s catch more about this film. Original title, rating and votes, release year, director, starring actors and of course we save the cover image. Original file name of the image is something like MV5BMTczMzE4Nzk3N15BMl5BanBnXkFtZTcwNDg5Mjc4NA @ @. _V1SX214.jpg, So we rename it to the title instead.

And the result of such an operation would provide:

Apply your callback functions on all value items and view the results.

To apply functions on selected elements, replace _all_ with your key value, like this:

Note that it is fine to use anonymous functions too.

Drawbacks

PHP itself is not suitable for long time-consuming operations, since the process is interrupted as soon as the user closes the web page, or when PHP's time limit is reached (however set_time_limit(0) is utilized in the construct method so right there should not be a problem).

Requirements

License

Copycat is released under LGPL.

Thanks

If this library is useful for you, say thanks buying me a coffee :coffee:!


All versions of copycat with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
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 gidlov/copycat contains the following files

Loading the files please wait ....