Quellcode dieses Indikators. Sammler: job_ads_indicator.py (Cron auf heissa, täglich), Seiten: index.php, api.php, rss.php. Zugangsdaten liegen getrennt und werden nicht angezeigt.

job_ads_indicator.pyjob_report.pyindex.phpapi.phprss.php roh
<?php
// jobindex/rss.php - RSS 2.0 feed: weekly indicator values, new METR models, hypothesis status. ?lang=en for English.
declare(strict_types=1);
require __DIR__ . '/lib.php';

header('Content-Type: application/rss+xml; charset=utf-8');
$D = jobindex_data($pdo);
$base = 'https://' . ($_SERVER['HTTP_HOST'] ?? 'web2.heissa.de') . dirname($_SERVER['SCRIPT_NAME']) . '/';
$x = fn($s) => htmlspecialchars((string)$s, ENT_XML1 | ENT_QUOTES, 'UTF-8');
$items = [];
$en = ($_GET['lang'] ?? 'de') === 'en';
$t = fn(string $de, string $e) => $en ? $e : $de;
$nf = fn($v, int $d = 1) => $v === null ? '–' : ($en ? number_format((float)$v, $d, '.', ',') : number_format((float)$v, $d, ',', '.'));
$q = $en ? '?lang=en&' : '?';

// weekly indicator values (last 12 weeks)
foreach (array_slice($D['weekly'], -12) as $r) {
    $items[] = ['date' => $r['day'], 'guid' => 'indicator-' . $r['day'],
        'title' => sprintf($t('Indikator %s: Verhältnis Denkarbeit/Handwerk %s (365 Tage %s)', 'Indicator %s: ratio knowledge work/trades %s (365 days %s)'),
                           $r['day'], $nf($r['r']), $nf($r['r365'])),
        'desc' => sprintf($t('Denkarbeit %s, Handwerk %s (Indeed, neue Anzeigen, Feb 2020 = 100). Verhältnis: Jahr vor ChatGPT = 100.',
                             'Knowledge work %s, trades %s (Indeed, new postings, Feb 2020 = 100). Ratio: year before ChatGPT = 100.'), $nf($r['k']), $nf($r['t'])),
        'link' => $base . $q . 'tab=overview'];
}
// METR models of the fit suite (newest 10)
$models = array_values(array_filter($D['mainPts'], fn($p) => $p['suite'] === $D['fitSuite']));
usort($models, fn($a, $b) => strcmp($b['released'], $a['released']));
foreach (array_slice($models, 0, 10) as $p) {
    $items[] = ['date' => $p['released'], 'guid' => 'metr-' . $p['suite'] . '-' . $p['model'],
        'title' => sprintf($t('METR: %s – 50 %%-Zeithorizont %s h (%s)', 'METR: %s – 50 %% time horizon %s h (%s)'), $p['model'], $nf($p['h50_min'] / 60, 1), $p['suite']),
        'desc' => sprintf($t('Veröffentlicht %s, %s. Trend: Verdopplung alle %s Monate.', 'Released %s, %s. Trend: doubling every %s months.'), $p['released'],
                          $p['frontier'] ? $t('Spitzenmodell', 'frontier model') : $t('kein Spitzenmodell', 'not a frontier model'), $nf($D['doubling'])),
        'link' => $base . $q . 'tab=models'];
}
if ($h = $D['hyp']) {
    $items[] = ['date' => $h['result_day'] ?? substr($h['created'], 0, 10), 'guid' => 'hypothesis-' . $h['id'] . ($h['result_day'] ? '-result' : ''),
        'title' => $h['result_day'] ? $t('Hypothese geprüft: ', 'Hypothesis checked: ') . $h['result_text']
                                    : $t('Hypothese festgelegt, Prüfung am ', 'Hypothesis set, check on ') . $h['check_day'],
        'desc' => $h['h1_text'], 'link' => $base . $q . 'tab=overview'];
}
usort($items, fn($a, $b) => strcmp($b['date'], $a['date']));
echo '<?xml version="1.0" encoding="UTF-8"?>', "\n";
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
 <title><?= $x($t('KI-Frühindikator Stellenanzeigen', 'AI Early Indicator: Job Ads')) ?></title>
 <link><?= $x($base . ($en ? '?lang=en' : '')) ?></link>
 <atom:link href="<?= $x($base . 'rss.php' . ($en ? '?lang=en' : '')) ?>" rel="self" type="application/rss+xml"/>
 <description><?= $x($t('Stellenanzeigen für KI-nahe Denkarbeit gegen Handwerk (Indeed DE) und METR-Zeithorizont der KI-Modelle. JSON-API: ',
                        'Job ads for AI-exposed knowledge work vs. trades (Indeed Germany) and the METR time horizon of AI models. JSON API: ') . $base . 'api.php') ?></description>
 <language><?= $en ? 'en' : 'de-de' ?></language>
 <lastBuildDate><?= date(DATE_RSS) ?></lastBuildDate>
<?php foreach ($items as $it): ?>
 <item>
  <title><?= $x($it['title']) ?></title>
  <link><?= $x($it['link']) ?></link>
  <guid isPermaLink="false"><?= $x($it['guid']) ?></guid>
  <pubDate><?= date(DATE_RSS, strtotime($it['date'] . ' 12:00:00')) ?></pubDate>
  <description><?= $x($it['desc']) ?></description>
 </item>
<?php endforeach; ?>
</channel>
</rss>