This commit is contained in:
Vincent Riquer 2022-04-28 15:29:36 +02:00
parent 469c4a660a
commit 5eae26057f
3 changed files with 27 additions and 6 deletions

View File

@ -22,7 +22,7 @@ image() {
declare -A values declare -A values
tmpfile=$(mktemp --suffix=.tiff) 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 )) if (( debug_import >= 3 ))
then then
@ -216,6 +216,12 @@ image() {
value=${value//_/} value=${value//_/}
read values[Recruiter] junk <<<"${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 esac
done done

View File

@ -18,9 +18,9 @@
send_headers() { send_headers() {
local timestamp do_exit header thisdate expiredate 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) 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 ]] if [[ $thisdate == $HTTP_IF_MODIFIED_SINCE ]]
then then
echo "Status: 304 Not Modified" echo "Status: 304 Not Modified"
@ -28,7 +28,7 @@ send_headers() {
fi fi
echo "Last-Modified: $thisdate" echo "Last-Modified: $thisdate"
echo "Expires: $expiredate" echo "Expires: $expiredate"
echo "Cache-Control: must-revalidate, max-age=${1:-60}" echo "Cache-Control: must-revalidate, max-age=${1:-5}"
while read header while read header
do do
echo "$header" echo "$header"

View File

@ -24,7 +24,7 @@ CACHE_DIR=/web/ingress-stats.riquer.fr/cache/
# /cgi/$user/add.html # /cgi/$user/add.html
IFS=/ read garbage garbage webuser garbage <<<"$REQUEST_URI" IFS=/ read garbage garbage webuser garbage <<<"$REQUEST_URI"
debug_import=2 debug_import=3
rrdfile=ingress.rrd rrdfile=ingress.rrd
@ -86,6 +86,7 @@ declare -A uinames=(
[Hacker]=Hacks [Hacker]=Hacks
[Translator]="Glyph Hack Points" [Translator]="Glyph Hack Points"
[Recruiter]="Agents Recruited" [Recruiter]="Agents Recruited"
[Hackaton]="Consecutive Days Hacking"
) )
dsnames=( dsnames=(
AP AP
@ -125,16 +126,18 @@ medals=(
Builder Builder
Connector Connector
Mind_Controller Mind_Controller
MU
Recharger Recharger
Liberator Liberator
Pioneer Pioneer
Purifier Purifier
Guardian Guardian
Mercenary
Engineer Engineer
Hacker Hacker
Translator Translator
Recruiter Recruiter
Hackaton
Mercenary
) )
## (0) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ## (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 platinum["Translator"]=20000
black["Translator"]=50000 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[""]= #bronze[""]=
#silver[""]= #silver[""]=
#gold[""]= #gold[""]=