diff options
-rwxr-xr-x | cli.js | 4 | ||||
-rw-r--r-- | zeitung/parts/studenttemplate.tex | 9 | ||||
-rw-r--r-- | zeitung/placeholder/.gitignore | 1 | ||||
-rwxr-xr-x | zeitung/placeholder/get.sh | 12 |
4 files changed, 22 insertions, 4 deletions
@@ -100,7 +100,7 @@ if ((idx = params.indexOf("-r")) > -1) { const chars = user.chars; hay = curr; const obj = { - id: user.id, // Why tf tho + id: user.id, name: `${user.name} ${user.middlename || ""} ${user.surname}`, birthday: answer("Geburtsdatum"), favsub: answer("Lieblingsfach"), @@ -115,7 +115,7 @@ if ((idx = params.indexOf("-r")) > -1) { obj.birthday = new Date(obj.birthday == "nichts" ? "1.1.2000" : obj.birthday).toLocaleDateString("de"); - // QR-Code.. DON'T ASK + // QR-Code.. DON'T ASK TODO: Fix for last student? hay = next; obj.qrcode = answer("QR-Code Text (z.B. Social Media Links, random Text, whatever)").replace(/ /g, "\\ "); if (obj.qrcode === "nichts") obj.qrcode = ""; diff --git a/zeitung/parts/studenttemplate.tex b/zeitung/parts/studenttemplate.tex index 403384c..04eeaf3 100644 --- a/zeitung/parts/studenttemplate.tex +++ b/zeitung/parts/studenttemplate.tex @@ -42,7 +42,12 @@ \AddToShipoutPictureBG*{ \AtTextUpperLeft{ \put(-\ringx + \ringoffset, -\ringy + \ringoffset){ - \dfincludegraphics[keepaspectratio=true, width=\frameimgwidth]{parts/generated/students/figures/36_#1.jpg} + \def\imgpath{parts/generated/students/figures/36_#1.jpg} + \IfFileExists{\imgpath}{} + { + \def\imgpath{placeholder/#1.jpg} + } + \includegraphics[keepaspectratio=true, width=\frameimgwidth]{\imgpath} } \put(-\ringx, -\ringy){ \includegraphics[keepaspectratio=true, width=\ringwidth]{ring.png} @@ -57,7 +62,7 @@ } \put(\textwidth - \qrcodex, \framey - 25pt){ \ifdefempty{\stdqrcode}{}{ - \qrcode[nolink, height=0.7in]{#2} + \qrcode[nolink, height=0.7in]{\stdqrcode} } } } diff --git a/zeitung/placeholder/.gitignore b/zeitung/placeholder/.gitignore new file mode 100644 index 0000000..76ce7fc --- /dev/null +++ b/zeitung/placeholder/.gitignore @@ -0,0 +1 @@ +*.jpg diff --git a/zeitung/placeholder/get.sh b/zeitung/placeholder/get.sh new file mode 100755 index 0000000..000e14a --- /dev/null +++ b/zeitung/placeholder/get.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +MAX=300 +if [[ ! -z "$1" ]]; then + MAX=$1 +fi + +for i in $( seq $MAX ); do +FILE=${i}.jpg +curl 'https://thispersondoesnotexist.com/image' -H 'authority: thispersondoesnotexist.com' -H 'pragma: no-cache' -H 'cache-control: no-cache' -H 'upgrade-insecure-requests: 1' -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36' -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3' -H 'referer: https://thispersondoesnotexist.com/' -H 'accept-encoding: gzip, deflate, br' -H 'accept-language: en-US,en;q=0.9' --compressed -o $FILE +sleep 1 +done |