diff --git a/README.md b/README.md index a5007fe..9433ff9 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Then add your script to crontab: ```bash sudo crontab -e -0 * * * * php crontab.php +*/15 * * * * php crontab.php ``` ### Monolog integration @@ -51,4 +51,19 @@ $monolog = new Logger('Reviewer'); $monolog->pushHandler(new StreamHandler('/tmp/reviewer.log', Logger::DEBUG)); $reviewer->setLogger($monolog); +``` + +### Countries +There is a way to change set of countries from whence Reviewer is getting fresh app's reviews. + +```php +try { + $reviewer = new TJ\Reviewer({APPID}); + ... + $reviewer->countries = ['ru' => 'Russia', 'us' => 'US', 'fi' => 'Finland', 'fr' => 'France']; + + $reviewer->start(); +} catch (Exception $e) { + // handle errors +} ``` \ No newline at end of file diff --git a/src/Reviewer.php b/src/Reviewer.php index 4c5d6be..ada178d 100755 --- a/src/Reviewer.php +++ b/src/Reviewer.php @@ -168,11 +168,12 @@ public function getReviewsByCountry($appId, $countryCode, $countryName) if (!isset($reviewsData['feed']) || !isset($reviewsData['feed']['entry']) || count($reviewsData['feed']['entry']) == 0) { // Received empty page if ($this->logger) { - $this->logger->debug('Empty page received for page ' . $realPage . ' and country ' . $countryCode); + $this->logger->debug("#{$appId}: Received 0 entries for page {$realPage} in {$countryName}"); } } else { if ($this->logger) { - $this->logger->debug('Received ' . count($reviewsData['feed']['entry']) . ' entries for page ' . $realPage . ' in country ' . $countryCode); + $countEntries = count($reviewsData['feed']['entry']) - 1; + $this->logger->debug("#{$appId}: Received {$countEntries} entries for page {$realPage} in {$countryName}"); } $applicationData = [];