- feed_fetches: jeder Feed-Abruf mit Art, Schlüssel, Portal, Sprache, erkanntem Reader (config/feeds.php, FeedReaderIdentifier), vom Dienst gemeldeter Abonnentenzahl und gekürztem User-Agent — keine IP. Schreiben per defer() nach der Antwort, auch bei Cache-Treffer. - Aufbewahrung 395 Tage über press-releases:purge-events; FEED_FETCHES_RECORDED_SINCE. - Admin ▸ Reports ▸ Indexierung & Abrufe: Block „Abrufe der RSS-Feeds" (Summen je Feed-Art, je Reader-Dienst, meistabgerufene Feeds; FeedFetchReport, Verdichtung in PHP für MySQL und SQLite). - Panel „Auslieferung": Abrufe je Feed in 30 Tagen; RSS-Seite nennt die Zählung ohne IP. - Tests: FeedFetchLogTest (5), IndexStatusCheckTest erweitert. - dev/2026-09-01: Nachtrag Protokoll Teil 11, Roadmap 3.1; 0.7 gilt auch für Crawler- und Feed-Log. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\FeedFetch;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends Factory<FeedFetch>
|
|
*/
|
|
class FeedFetchFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'feed' => FeedFetch::FEED_PORTAL,
|
|
'feed_key' => null,
|
|
'portal' => 'presseecho',
|
|
'language' => 'de',
|
|
'reader' => 'feedly',
|
|
'subscribers' => 3,
|
|
'user_agent' => 'Feedly/1.0 (+http://www.feedly.com/fetcher.html; 3 subscribers; like FeedFetcher-Google)',
|
|
];
|
|
}
|
|
|
|
public function category(string $slug): static
|
|
{
|
|
return $this->state(['feed' => FeedFetch::FEED_CATEGORY, 'feed_key' => $slug]);
|
|
}
|
|
|
|
public function newsroom(string $slug): static
|
|
{
|
|
return $this->state(['feed' => FeedFetch::FEED_NEWSROOM, 'feed_key' => $slug]);
|
|
}
|
|
|
|
public function reader(?string $reader, ?int $subscribers = null, ?string $userAgent = null): static
|
|
{
|
|
return $this->state([
|
|
'reader' => $reader,
|
|
'subscribers' => $subscribers,
|
|
'user_agent' => $userAgent ?? (($reader ?? 'unknown').'-fetcher/1.0'),
|
|
]);
|
|
}
|
|
}
|