Skip to content

Commit

Permalink
lil’ touches
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoli Nicolae <nicolaeanatoli@gmail.com>
  • Loading branch information
anatolinicolae committed Feb 1, 2018
1 parent 06de6a7 commit b3e92f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Of course there are a lot of similar libraries, but this one should be the simplest and the most complete one of them all—at least that what we hope.

## Tech stack
The API is written in PHP, relies on [Guzzle](https://github.com/guzzle/guzzle) to consume the Envato Marketplace API and that's pretty much it.
The API is written in PHP, relies on [Guzzle](https://github.com/guzzle/guzzle) to consume the Envato Marketplace API and that's pretty much it. Heavily inspired by [Node version by Bailey Herbert](https://github.com/baileyherbert/node-envato-api).

## How to use
1. Require the package
Expand Down Expand Up @@ -57,8 +57,9 @@ The API is written in PHP, relies on [Guzzle](https://github.com/guzzle/guzzle)
$client->getSalesByMonth($args);
$client->getTotalMarketUsers($args);
$client->getTotalMarketItems($args);
$client->getTotalFilesBySite($site, $args)
$client->getTotalFilesBySite($site, $args);
```
Find each method signature and details at [https://build.envato.com/api/](https://build.envato.com/api/). All parameters are the same and should be passed as a key-value array as the latest argument of the method.

## License
The code in this repo and used modules are open-sourced software licensed under the [MIT license](LICENSE.md).
12 changes: 8 additions & 4 deletions src/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function makeRequest($path = '', $args = null)
'headers' => [
'Accept' => 'application/json',
'Authorization' => 'Bearer ' . $this->token,
'User-Agent' => $this->userAgent || 'envato-api/0.1'
'User-Agent' => $this->userAgent || 'envato-api/0.0.1'
]
];

Expand All @@ -45,7 +45,7 @@ protected function makeRequest($path = '', $args = null)
}

/**
* Catalog endpoints
* Envato Market Catalog
**/

public function getCollection($site, $args)
Expand Down Expand Up @@ -99,7 +99,7 @@ public function getRandomNewFiles($site, $args)
}

/**
* User details
* User Details
**/

public function getUserCollections($args)
Expand Down Expand Up @@ -133,7 +133,7 @@ public function getUsersNewItems($username, $site, $args)
}

/**
* Private user details
* Private User Details
**/

public function getSales($args)
Expand Down Expand Up @@ -176,6 +176,10 @@ public function getSalesByMonth($args)
return $this->makeRequest('/v1/market/private/user/earnings-and-sales-by-month.json');
}

/**
* Envato Market Stats
**/

public function getTotalMarketUsers($args)
{
return $this->makeRequest('/v1/market/total-users.json');
Expand Down

0 comments on commit b3e92f4

Please sign in to comment.