32 lines
1.1 KiB
PHP
32 lines
1.1 KiB
PHP
<?php
|
|
|
|
require __DIR__ . '/../vendor/autoload.php';
|
|
$app = require_once __DIR__ . '/../bootstrap/app.php';
|
|
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
|
|
|
$interns = App\Models\CareerApplication::where('type', 'internship')->where('status', 'accepted')->with(['journalEntries' => function($q) {
|
|
$q->orderBy('day_number', 'asc');
|
|
}])->get();
|
|
|
|
$report = [];
|
|
|
|
foreach ($interns as $intern) {
|
|
$entriesCount = $intern->journalEntries->count();
|
|
if ($entriesCount == 0) continue;
|
|
|
|
$contents = [];
|
|
foreach ($intern->journalEntries as $e) {
|
|
$contents[] = "Gün " . $e->day_number . " (" . $e->date . "):\n" . mb_substr(strip_tags($e->content), 0, 400);
|
|
}
|
|
|
|
$report[] = [
|
|
'name' => $intern->name,
|
|
'repo' => $intern->github_repo,
|
|
'entries_count' => $entriesCount,
|
|
'snippets' => array_slice($contents, -3) // Last 3 entries
|
|
];
|
|
}
|
|
|
|
file_put_contents(__DIR__ . '/intern_code_summaries.json', json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE));
|
|
echo "Generated summaries for " . count($report) . " interns.\n";
|