From 5eae26057f24ea70402492c6f1c00af66d479e25 Mon Sep 17 00:00:00 2001 From: Vincent Riquer Date: Thu, 28 Apr 2022 15:29:36 +0200 Subject: [PATCH] - --- lib/image | 8 +++++++- lib/send_headers | 6 +++--- settings | 19 +++++++++++++++++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/lib/image b/lib/image index 4d8f64d..60098ae 100755 --- a/lib/image +++ b/lib/image @@ -22,7 +22,7 @@ image() { declare -A values tmpfile=$(mktemp --suffix=.tiff) - transform='-resize 300%x200% -contrast -channel green -threshold 50%' + transform='-resize 350%x200% -contrast -channel green -threshold 50%' if (( debug_import >= 3 )) then @@ -216,6 +216,12 @@ image() { value=${value//_/} read values[Recruiter] junk <<<"${value//,/}" ;; + #Agents Recruited 1 + 'Consecutive Days Hacking'*) + value="${line#Consecutive Days Hacking }" + value=${value//_/} + read values[Hackaton] junk <<<"${value//,/}" + ;; esac done diff --git a/lib/send_headers b/lib/send_headers index f163bc3..2283412 100644 --- a/lib/send_headers +++ b/lib/send_headers @@ -18,9 +18,9 @@ send_headers() { local timestamp do_exit header thisdate expiredate - read timestamp < <(stat -c %Y $0 settings "$rrdfile" lib/* .importing 2>/dev/null|sort -r) + read timestamp < <(stat -c %Y $0 settings "$rrdfile" lib/* dav/* .importing 2>/dev/null|sort -r) thisdate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d @$timestamp) - expiredate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d "+${1:-60} second") + expiredate=$(LC_ALL=C TZ=GMT date +'%a, %d %b %Y %X %Z' -d "+${1:-5} second") if [[ $thisdate == $HTTP_IF_MODIFIED_SINCE ]] then echo "Status: 304 Not Modified" @@ -28,7 +28,7 @@ send_headers() { fi echo "Last-Modified: $thisdate" echo "Expires: $expiredate" - echo "Cache-Control: must-revalidate, max-age=${1:-60}" + echo "Cache-Control: must-revalidate, max-age=${1:-5}" while read header do echo "$header" diff --git a/settings b/settings index b0dc14e..cc9f844 100644 --- a/settings +++ b/settings @@ -24,7 +24,7 @@ CACHE_DIR=/web/ingress-stats.riquer.fr/cache/ # /cgi/$user/add.html IFS=/ read garbage garbage webuser garbage <<<"$REQUEST_URI" -debug_import=2 +debug_import=3 rrdfile=ingress.rrd @@ -86,6 +86,7 @@ declare -A uinames=( [Hacker]=Hacks [Translator]="Glyph Hack Points" [Recruiter]="Agents Recruited" + [Hackaton]="Consecutive Days Hacking" ) dsnames=( AP @@ -125,16 +126,18 @@ medals=( Builder Connector Mind_Controller + MU Recharger Liberator Pioneer Purifier Guardian - Mercenary Engineer Hacker Translator Recruiter + Hackaton + Mercenary ) ## (0) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 @@ -241,6 +244,18 @@ gold["Translator"]=6000 platinum["Translator"]=20000 black["Translator"]=50000 +bronze["MU"]=5000 +silver["MU"]=50000 +gold["MU"]=250000 +platinum["MU"]=1000000 +black["MU"]=4000000 + +bronze["Hackaton"]=15 +silver["Hackaton"]=30 +gold["Hackaton"]=60 +platinum["Hackaton"]=180 +black["Hackaton"]=365 + #bronze[""]= #silver[""]= #gold[""]=