Skip to content

Commit 3e6786f

Browse files
committed
wip
1 parent bbed0bd commit 3e6786f

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

app/Crawler.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,6 @@ public function sendRequests(RequestInterface ...$requests): array
7373
return $this->client->sendRequests(...$requests);
7474
}
7575

76-
info('Crawler::sendRequests regular', [
77-
'requests' => array_map(
78-
fn ($request) => $request->getUri(),
79-
$requests
80-
),
81-
]);
82-
8376
return array_map(
8477
fn ($request) => $this->client->sendRequest($request),
8578
$requests

app/DomainFilteringAdapter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public function __construct(EmbedAdapterInterface $decorated, array $allowedDoma
3737
*/
3838
public function updateEmbeds(array $embeds): void
3939
{
40-
info('DomainFilteringAdapter::updateEmbeds');
4140
$this->decorated->updateEmbeds(\array_values(\array_filter($embeds, function (Embed $embed): bool {
4241
return \preg_match($this->regex, $embed->getUrl()) === 1;
4342
})));

app/EmbedProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function __invoke(DocumentParsedEvent $event): void
5454
$embeds[] = $node;
5555
}
5656
}
57-
info('EmbedProcessor::__invoke');
57+
5858
$this->adapter->updateEmbeds($embeds);
5959

6060
foreach ($embeds as $embed) {

app/OscaroteroEmbedAdapter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ public function __construct(?EmbedLib $embed = null)
2929
*/
3030
public function updateEmbeds(array $embeds): void
3131
{
32-
$extractors = $this->embedLib->getMulti(...\array_map(static fn (Embed $embed) => $embed->getUrl(), $embeds));
33-
info(print_r($extractors, true));
32+
$urls = \array_map(static fn (Embed $embed) => $embed->getUrl(), $embeds);
33+
info('Extracting URLs', ['urls' => $urls]);
34+
$extractors = $this->embedLib->getMulti(...$urls);
35+
3436
foreach ($extractors as $i => $extractor) {
3537
if ($extractor->code !== null) {
3638
$embeds[$i]->setEmbedCode($extractor->code->html);

0 commit comments

Comments
 (0)