1. Go to this page and download the library: Download ondrakoupil/heureka-recenze library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ondrakoupil / heureka-recenze example snippets
use \OndraKoupil\Heureka\EshopReviewsClient, \OndraKoupil\Heureka\EshopReview,
\OndraKoupil\Heureka\ProductReviewsClient, \OndraKoupil\Heureka\ProductReview, \OndraKoupil\Heureka\ProductReviewSummary;
$client = new EshopReviewsClient("my-secret-key");
$client2 = new EshopReviewsClient("http://www.heureka.sk/direct/dotaznik/export-review.php?key=my-secret-key");
$client3 = new ProductReviewsClient("my-secret-key");
$client4 = new ProductReviewsClient("http://www.heureka.sk/direct/dotaznik/export-product-review.php?key=my-secret-key");
$client5 = new ProductReviewsClient("my-secret-key", new DateTime("now - 1 month") );
$client6 = new EshopReviewsClient();
$client6->setSourceAddress("http://www.heureka.cz/direct/dotaznik/export-review.php?key=my-secret-key");
$client->setTempFile("tempfile.xml");
$client->setCallback(
function(EshopReview $review){
// ... zde si udělejte, co hrdlo ráčí
print_r($review->getAsArray());
}
);
$client->run();
// Všechna nalezená ID produktů jako array
$client->getAllProductIds();
// Všechny souhrnné informace jako array [ID_produktu] => ProductReviewSummary
$client->getAllSummaries();
// Souhrn recenzí o produktu s konkrétním ID jako objekt ProductReviewSummary
$summary = $client->getSummaryOfProduct(12345);
echo"Celkem $summary->reviewCount recenzí, hodnocení $summary->averageRating z 5";
// Všechny recenze týkající se konkrétního produktu
$reviews = $client->getReviewsOfProduct(12345);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.