Skip to content

Commit

Permalink
~ example
Browse files Browse the repository at this point in the history
  • Loading branch information
vantoozz committed Feb 20, 2021
1 parent ca71108 commit 402e0be
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions examples/07-metrics.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
<?php declare(strict_types=1);

use Vantoozz\ProxyScraper\Proxy;
use Vantoozz\ProxyScraper\Scrapers\FreeProxyListScraper;
use Vantoozz\ProxyScraper\Scrapers;

require_once __DIR__ . '/../vendor/autoload.php';

$httpClient = guzzleHttpClient();
$scraper = new Scrapers\FreeProxyListScraper(guzzleHttpClient());

$scraper = new FreeProxyListScraper($httpClient);

/** @var Proxy $proxy */
$proxy = $scraper->get()->current();

foreach ($proxy->getMetrics() as $metric) {
echo $metric->getName() . ': ' . $metric->getValue() . "\n";
foreach ($scraper->get() as $proxy) {
echo $proxy . "\n";
}

0 comments on commit 402e0be

Please sign in to comment.