Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/rem42/scraper-tinypng

TinyPNG uploader via scraper
https://github.com/rem42/scraper-tinypng

Last synced: 3 days ago
JSON representation

TinyPNG uploader via scraper

Awesome Lists containing this project

README

        

Scraper TinyPNG
=======

This scraper TinyPNG use [Scraper](https://github.com/rem42/scraper).

Installation
------------

````bash
$ composer require rem42/scraper-tinypng "^1.0"
````

Configuration
-------------

Nothing Needed

Usage
-----

````php
setFileContent(file_get_contents('path to your file'))
->setUserAgent('Need a browser user agent to work !')
;

$client = new Client();
$result = $client->api($request);
````

In the result var there is the Upload entity wich contains all the result from tinypng json response serialized in this entity.

You can also use a web upload and you only need tu set an url :

````php
setUrl('url to your file')
->setUserAgent('Need a browser user agent to work !')
;

$client = new Client();
$result = $client->api($request);
````