web: Crawler-Abruf-Protokoll und Panel „Auslieferung" ohne Google-Link (Anhang 1: 1c.0, 1c.1, 1c.6)
Abrufe öffentlicher Meldungen durch bekannte Such- und KI-Dienste werden je Meldung mit Dienst, gekürztem User-Agent und Zeitpunkt protokolliert — keine IP. Dienste und Muster stehen in config/crawlers.php. Aufzeichnung wie der Aufruf-Zähler per defer() und fehlertolerant; Bereinigung hängt an press-releases:purge-events. VisibilityStats liefert die Abrufe je Dienst (letzter Abruf, Anzahl) und verliert den site:-Suchlink (Stufe 1 verspricht nichts, was von Dritten abhängt). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
134af424ea
commit
951b6c47fa
10 changed files with 440 additions and 7 deletions
33
database/factories/PressReleaseCrawlerHitFactory.php
Normal file
33
database/factories/PressReleaseCrawlerHitFactory.php
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\PressRelease;
|
||||
use App\Models\PressReleaseCrawlerHit;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<PressReleaseCrawlerHit>
|
||||
*/
|
||||
class PressReleaseCrawlerHitFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'press_release_id' => PressRelease::factory(),
|
||||
'service' => 'openai',
|
||||
'user_agent' => 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; GPTBot/1.2; +https://openai.com/gptbot)',
|
||||
];
|
||||
}
|
||||
|
||||
public function service(string $service, ?string $userAgent = null): static
|
||||
{
|
||||
return $this->state([
|
||||
'service' => $service,
|
||||
'user_agent' => $userAgent ?? $service.'-crawler/1.0',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Crawler-Abruf-Protokoll (Roadmap 1c.0): Abrufe öffentlicher Meldungen
|
||||
* durch bekannte Such- und KI-Dienste, erkannt am User-Agent.
|
||||
*
|
||||
* Reines Append-Log ohne Personenbezug: Dienst, gekürzter User-Agent,
|
||||
* Zeitpunkt, Meldung. Keine IP-Adresse. Die Daten entstehen erst ab dem
|
||||
* Einschalten und lassen sich nicht rückwirkend erzeugen.
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('press_release_crawler_hits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('press_release_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('service', 40);
|
||||
$table->string('user_agent', 255);
|
||||
$table->timestamp('created_at')->nullable();
|
||||
|
||||
$table->index(['press_release_id', 'created_at'], 'prch_release_created_idx');
|
||||
$table->index(['service', 'created_at'], 'prch_service_created_idx');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('press_release_crawler_hits');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue