Skip to content

Instantly share code, notes, and snippets.

View marceljuenemann's full-sized avatar

Marcel Juenemann marceljuenemann

View GitHub Profile
@marceljuenemann
marceljuenemann / dwz-update.php
Created April 2, 2023 13:55
DSB DWZ Datenbank aktualisieren
<?php
function autodwz ( $lv, $db )
{
$zip = new ZipArchive;
$url = "https://dwz.svw.info/services/files/export/sql/LV-$lv-sql.zip";
echo "Lade $lv.\r\n";
if ( !copy ( $url, "dwz.zip" ) )
{ echo "Fehler!"; return; }
@marceljuenemann
marceljuenemann / nsv-team-api.php
Last active September 1, 2025 20:24
This is an example showing how to use the NSV API for fetching details about a team. The code is an AI-generated adaptation of the twig templates used in the actual production system.
<?php
$team = json_decode(file_get_contents("https://nsv-online.de/ligen/bezirk1-2425/api/teams/7951/"));
if (!empty($team->pairingsByDivision)) {
echo '<div class="col-12 col-lg-6 nsv-print-w50">';
foreach ($team->pairingsByDivision as $divisionId => $pairings) {
// You may need to fetch division info separately
echo "<h4 class='mt-4'>Division $divisionId</h4>";
echo "<table class='nsv-table text-center'><tr>