@extends('layouts.admin') @section('title', 'News Importer') @section('content')

News Importer

Import licensed news from NewsAPI.org into your database.

← Back to articles
@if (session('success'))

{{ session('success') }}

@if (session('import_output'))
{{ session('import_output') }}
@endif
@endif @if (session('error'))
{{ session('error') }}
@endif
Total articles
{{ $stats['total'] }}
From NewsAPI
{{ $stats['imported'] }}
Imported (24h)
{{ $stats['last_24h'] }}
Images cached
{{ $stats['images'] }}

API Connection

@if ($connection['ok'])
Connected. {{ $connection['total_results'] ?? 0 }} AU results available.
@else
Not connected: {{ $connection['error'] }}

Get a free API key at newsapi.org/register and add it to your .env as NEWSAPI_KEY.

@endif
@csrf

Run an import

Free tier limited to last ~30 days

Valid AU: {{ implode(', ', array_keys($sources)) }}

Copyright note: Imports include headline, summary, and image with a "Read full article at source →" attribution link. NewsAPI free tier is for development only; production use requires a paid plan.

Recent imports

@forelse ($recentImports as $article) @empty @endforelse
Title Source Published Image
{{ Str::limit($article->title, 60) }} {{ $article->source_name }} {{ $article->published_at?->format('Y-m-d') }} @if ($article->featured_image) ✓ @else — @endif source ↗
No imports yet.
@endsection