Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Command/NotifySearchEngineCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->stackRepository->deleteByUid($stack->getUid());
}

$this->logger->info(sprintf('Batch sent (%d URLs), all entries deleted', count($uids)));
$output->writeln(sprintf('<info>Batch sent (%d URLs), all entries deleted.</info>', count($uids)));
$this->logger->info(sprintf('Batch sent (%d URLs), all entries deleted', $stackStorage->count()));
$output->writeln(sprintf('<info>Batch sent (%d URLs), all entries deleted.</info>', $stackStorage->count()));

return self::SUCCESS;
}
Expand Down
18 changes: 9 additions & 9 deletions Classes/Notifier/SearchEngineNotifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,18 @@ protected function notifySingleStack(Stack $stack): bool
return $isValidRequest;
}

/**
* @throws ApiKeyNotAvailableException
*/
protected function getUrlForSingleNotification(Stack $stack): string
{
// Do not surround with try-catch. It should break in scheduler/cli
// if no API key is available to inform the user visually
$uri = new Uri($this->extConf->getSearchEngineEndpoint());

try {
$uri = $uri->withQuery(HttpUtility::buildQueryString([
'url' => $stack->getUrl(),
'key' => $this->extConf->getApiKey(),
]));
} catch (ApiKeyNotAvailableException) {
return '';
}
$uri = $uri->withQuery(HttpUtility::buildQueryString([
'url' => $stack->getUrl(),
'key' => $this->extConf->getApiKey(),
]));

return (string)$uri;
}
Expand Down
7 changes: 2 additions & 5 deletions Resources/Private/Language/ExtConf.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
<source>API Key: Each request needs an API key to identify your URLs. You can build one here: https://www.bing.com/indexnow</source>
</trans-unit>
<trans-unit id="searchEngineEndpoint">
<source>Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values.</source>
</trans-unit>
<trans-unit id="enableDebug">
<source>Enable debug mode: In case of problems it can help to activate the debug mode. In this case, additional information is displayed in the backend, such as the URL that is sent to the search engines.</source>
<source>Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content.</source>
</trans-unit>
<trans-unit id="notifyBatchMode">
<source>Notify batch mode: if enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch.</source>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
8 changes: 2 additions & 6 deletions Resources/Private/Language/de.ExtConf.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
</trans-unit>
<trans-unit id="searchEngineEndpoint">
<source>Search Engine Endpoint: Define the index-now URL of searchengine which should be used to inform about modified content. Use ###URL### and ###APIKEY### for dynamic values.</source>
<target>Endpunkt der Suchmaschine: Geben Sie hier die index-now URL zum Suchmaschinenanbieter an, um ihn über aktualisierte Inhalte zu informieren. Verwende ###URL### und ###APIKEY### als dynamische Werte.</target>
</trans-unit>
<trans-unit id="enableDebug">
<source>Enable debug mode: In case of problems it can help to activate the debug mode. In this case, additional information is displayed in the backend, such as the URL that is sent to the search engines.</source>
<target>Debug Modus aktivieren: Bei Problemen kann es helfen des Debug Modus zu aktivieren. In diesem Falle werden zusätzliche Informationen im Backend ausgegeben, wie z.B. die URL, die an die Suchmaschinen gesendet wird.</target>
<target>Endpunkt der Suchmaschine: Geben Sie hier die index-now URL zum Suchmaschinenanbieter an, um ihn über aktualisierte Inhalte zu informieren.</target>
</trans-unit>
<trans-unit id="notifyBatchMode">
<source>If this checkbox is enabled, the search engine will be notified using batch mode. This means that modified URLs are sent in a single request. A maximum of 10,000 URLs can be sent per batch.</source>
<target>Benachrichtigung im Batch-Modus aktivieren: Wenn diese Checkbox aktiviert ist, wird die Suchmaschine im Batch-Modus benachrichtigt. Das bedeutet, dass geänderte URLs gesammelt in einer einzigen Anfrage gesendet werden. Pro Durchgang können maximal 10.000 URLs übermittelt werden.</target>
</trans-unit>
</body>
</file>
</xliff>
</xliff>
2 changes: 0 additions & 2 deletions ext_conf_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
apiKey =
# cat=basic; type=string; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:searchEngineEndpoint
searchEngineEndpoint = https://www.bing.com/indexnow
# cat=basic; type=boolean; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:enableDebug
enableDebug = 0
# cat=basic; type=boolean; label=LLL:EXT:indexnow/Resources/Private/Language/ExtConf.xlf:notifyBatchMode
notifyBatchMode = 0
2 changes: 1 addition & 1 deletion ext_emconf.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'author' => 'Stefan Froemken',
'author_email' => 'sfroemken@jweiland.net',
'state' => 'experimental',
'version' => '0.0.7',
'version' => '0.0.8',
'constraints' => [
'depends' => [
'typo3' => '12.4.31-13.4.99',
Expand Down