Zuletzt aktualisiert am 13.06.2023 um 10:06 Uhr
Um von Bootswatch alle Themes für Bootstrap automatisch herunterladen zu können, gibt es ein kleines “Script” für das Terminal, als auch PHP. Momentan gibt es 25 verschiedene Themes, die sozusagen auf einmal heruntergeladen werden können.
Alle Scripte ohne Gewähr!
PHP-Variante
<?php
/*
Dieses Script kommt so wie es ist und es wird keine Gewähr übernommen.
*/
/* Einstellungen */
$URL='https://bootswatch.com/'; /* Aktuelle URL */
$VERSION='5'; /* Aktuelle Version */
$TARGET='./'; /* kann so bleiben, wenn sich das Script im gleichen Verzeichnis befindet */
$ERROR_MSG_OK = 'wurde erfolgreich kopiert.';
$ERROR_MSG_FAILED = ': Fehler: Datei nicht gefunden.';
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Theme-Downloader für Bootswatch</title>
<style>
body{background:#333;color:#fff;}
a{border:.1rem #111 solid;background:#666;color:#fff;display:block;width:16rem;padding:.5rem;text-align:center;text-decoration:none;}
a:hover{background:rgb(80,80,120);color:#fff;}
</style>
</head>
<body>
<h1>Theme-Downloader für Bootswatch</h1>
<a href="?504r504tr54t0zt54z=start">Themes herunterladen</a>
<p>Der Download kann etwas dauern...</p>
<h2>Ausgabe</h2>
<?php
switch($_GET['504r504tr54t0zt54z']) {
case 'start':
print '<ol>';
$cerulean='cerulean'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$cerulean.'.min.css')){print '<li>'.$cerulean.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$cerulean.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$cosmo='cosmo'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$cosmo.'.min.css')){print '<li>'.$cosmo.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$cosmo.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$cyborg='cyborg'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$cyborg.'.min.css')){print '<li>'.$cyborg.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$cyborg.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$darkly='darkly'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$darkly.'.min.css')){print '<li>'.$darkly.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$darkly.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$flatly='flatly'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$flatly.'.min.css')){print '<li>'.$flatly.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$flatly.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$journal='journal'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$journal.'.min.css')){print '<li>'.$journal.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$journal.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$litera='litera'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$litera.'.min.css')){print '<li>'.$litera.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$litera.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$lumen='lumen'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$lumen.'.min.css')){print '<li>'.$lumen.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$lumen.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$lux='lux'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$lux.'.min.css')){print '<li>'.$lux.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$lux.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$materia='materia'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$materia.'.min.css')){print '<li>'.$materia.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$materia.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$minty='minty'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$minty.'.min.css')){print '<li>'.$minty.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$minty.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$morph='morph'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$morph.'.min.css')){print '<li>'.$morph.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$morph.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$pulse='pulse'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$pulse.'.min.css')){print '<li>'.$pulse.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$pulse.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$quartz='quartz'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$quartz.'.min.css')){print '<li>'.$quartz.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$quartz.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$sandstone='sandstone'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$sandstone.'.min.css')){print '<li>'.$sandstone.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$sandstone.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$simplex='simplex'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$simplex.'.min.css')){print '<li>'.$simplex.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$simplex.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$sketchy='sketchy'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$sketchy.'.min.css')){print '<li>'.$sketchy.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$sketchy.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$slate='slate'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$slate.'.min.css')){print '<li>'.$slate.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$slate.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$solar='solar'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$solar.'.min.css')){print '<li>'.$solar.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$solar.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$spacelab='spacelab'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$spacelab.'.min.css')){print '<li>'.$spacelab.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$spacelab.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$superhero='superhero'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$superhero.'.min.css')){print '<li>'.$superhero.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$superhero.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$united='united'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$united.'.min.css')){print '<li>'.$united.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$united.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$vapor='vapor'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$vapor.'.min.css')){print '<li>'.$vapor.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$vapor.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$yeti='yeti'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$yeti.'.min.css')){print '<li>'.$yeti.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$yeti.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
$zephyr='zephyr'; if (copy($URL .'/'.$VERSION.'/'.$cerulean.'/bootstrap.min.css', $TARGET . '/'.$zephyr.'.min.css')){print '<li>'.$zephyr.'.min.css '.$ERROR_MSG_OK.'</li>';}else{print '<li>'.$zephyr.'.min.css '.$ERROR_MSG_FAILED.'</li>';}
print '</ol><p>Fertig</p>';
break;
default:
// keine Ausgabe.
break;
}
?>
</body>
</html>
Shell-Script
wget
#! /bin/sh
# Dieses Script kommt so wie es ist und es wird keine Gewähr übernommen!
URL="https://bootswatch.com/"
VERSION="5"
TARGET="."
WGET_PARAMETER_PREFIX="-q --show-progress"
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/cerulean/bootstrap.min.css" -O ${TARGET}/cerulean.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/cosmo/bootstrap.min.css" -O ${TARGET}/cosmo.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/cyborg/bootstrap.min.css" -O ${TARGET}/cyborg.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/darkly/bootstrap.min.css" -O ${TARGET}/darkly.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/flatly/bootstrap.min.css" -O ${TARGET}/flatly.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/journal/bootstrap.min.css" -O ${TARGET}/journal.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/litera/bootstrap.min.css" -O ${TARGET}/litera.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/lumen/bootstrap.min.css" -O ${TARGET}/lumen.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/lux/bootstrap.min.css" -O ${TARGET}/lux.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/materia/bootstrap.min.css" -O ${TARGET}/materia.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/minty/bootstrap.min.css" -O ${TARGET}/minty.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/morph/bootstrap.min.css" -O ${TARGET}/morph.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/pulse/bootstrap.min.css" -O ${TARGET}/pulse.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/quartz/bootstrap.min.css" -O ${TARGET}/quartz.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/sandstone/bootstrap.min.css" -O ${TARGET}/sandstone.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/simplex/bootstrap.min.css" -O ${TARGET}/simplex.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/sketchy/bootstrap.min.css" -O ${TARGET}/sketchy.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/slate/bootstrap.min.css" -O ${TARGET}/slate.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/solar/bootstrap.min.css" -O ${TARGET}/solar.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/spacelab/bootstrap.min.css" -O ${TARGET}/spacelab.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/superhero/bootstrap.min.css" -O ${TARGET}/superhero.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/united/bootstrap.min.css" -O ${TARGET}/united.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/vapor/bootstrap.min.css" -O ${TARGET}/vapor.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/yeti/bootstrap.min.css" -O ${TARGET}/yeti.min.css
wget ${WGET_PARAMETER_PREFIX} "${URL}/${VERSION}/zephyr/bootstrap.min.css" -O ${TARGET}/zephyr.min.css
curl
#! /bin/sh
# Dieses Script kommt so wie es ist und es wird keine Gewähr übernommen!
URL="https://bootswatch.com/"
VERSION="5"
TARGET="."
curl "${URL}/${VERSION}/cerulean/bootstrap.min.css" -o ${TARGET}/cerulean.min.css
curl "${URL}/${VERSION}/cosmo/bootstrap.min.css" -o ${TARGET}/cosmo.min.css
curl "${URL}/${VERSION}/cyborg/bootstrap.min.css" -o ${TARGET}/cyborg.min.css
curl "${URL}/${VERSION}/darkly/bootstrap.min.css" -o ${TARGET}/darkly.min.css
curl "${URL}/${VERSION}/flatly/bootstrap.min.css" -o ${TARGET}/flatly.min.css
curl "${URL}/${VERSION}/journal/bootstrap.min.css" -o ${TARGET}/journal.min.css
curl "${URL}/${VERSION}/litera/bootstrap.min.css" -o ${TARGET}/litera.min.css
curl "${URL}/${VERSION}/lumen/bootstrap.min.css" -o ${TARGET}/lumen.min.css
curl "${URL}/${VERSION}/lux/bootstrap.min.css" -o ${TARGET}/lux.min.css
curl "${URL}/${VERSION}/materia/bootstrap.min.css" -o ${TARGET}/materia.min.css
curl "${URL}/${VERSION}/minty/bootstrap.min.css" -o ${TARGET}/minty.min.css
curl "${URL}/${VERSION}/morph/bootstrap.min.css" -o ${TARGET}/morph.min.css
curl "${URL}/${VERSION}/pulse/bootstrap.min.css" -o ${TARGET}/pulse.min.css
curl "${URL}/${VERSION}/quartz/bootstrap.min.css" -o ${TARGET}/quartz.min.css
curl "${URL}/${VERSION}/sandstone/bootstrap.min.css" -o ${TARGET}/sandstone.min.css
curl "${URL}/${VERSION}/simplex/bootstrap.min.css" -o ${TARGET}/simplex.min.css
curl "${URL}/${VERSION}/sketchy/bootstrap.min.css" -o ${TARGET}/sketchy.min.css
curl "${URL}/${VERSION}/slate/bootstrap.min.css" -o ${TARGET}/slate.min.css
curl "${URL}/${VERSION}/solar/bootstrap.min.css" -o ${TARGET}/solar.min.css
curl "${URL}/${VERSION}/spacelab/bootstrap.min.css" -o ${TARGET}/spacelab.min.css
curl "${URL}/${VERSION}/superhero/bootstrap.min.css" -o ${TARGET}/superhero.min.css
curl "${URL}/${VERSION}/united/bootstrap.min.css" -o ${TARGET}/united.min.css
curl "${URL}/${VERSION}/vapor/bootstrap.min.css" -o ${TARGET}/vapor.min.css
curl "${URL}/${VERSION}/yeti/bootstrap.min.css" -o ${TARGET}/yeti.min.css
curl "${URL}/${VERSION}/zephyr/bootstrap.min.css" -o ${TARGET}/zephyr.min.css