HabitRPG/habitrpg — pull request #3960 by Alys (2014-09-01 09:38:18+00:00)
Title: count how many users own wondercon Unconventional Armor and Halloween Spooky Skins

Same script as in https://github.com/HabitRPG/habitrpg/pull/3884 but now includes Halloween 2013 Spooky Skins, as requested by @lemoness. Also rewritten to be better, and to make it easy to add different types of items to report on in future.

@lefnire : Edit the script to use one of the `var dbUsers` lines then run with
`node database_reports/count_users_who_own_specified_gear.js`

Sample output:
````
CSV DATA:

"Unconventional Armor ownership"
"date","back_special_wondercon_black","back_special_wondercon_red","body_special_wondercon_black","body_special_wondercon_gold","body_special_wondercon_red","headAccessory_special_wondercon_black","headAccessory_special_wondercon_red"
"2014-09-01","7","7","7","7","7","7","9"

"Spooky Skins purchases"
"date","ghost","monster","pumpkin","shadow","skeleton","zombie"
"2014-09-01","2","3","3","6","4","3"

READABLE DATA:

2014-09-01

Unconventional Armor ownership:
back_special_wondercon_black: 7
back_special_wondercon_red: 7
body_special_wondercon_black: 7
body_special_wondercon_gold: 7
body_special_wondercon_red: 7
headAccessory_special_wondercon_black: 7
headAccessory_special_wondercon_red: 9

Spooky Skins purchases:
ghost: 2
monster: 3
pumpkin: 3
shadow: 6
skeleton: 4
zombie: 3
````

Also, this is the final line of the STDERR stream:
`400100 users searched (should be >400k)`
It should be useful to check if the entire set of users was actually searched through. I'm still not happy with the apparently low take-up of the wondercon gear as reported by the previous version of this script. @lefnire, does the "coupons" collection tell you how many coupons have been used by players?

Writing this code made me so sad that I bought only two of the Spooky Skins when they were available, instead of the whole set! I was foolish. :)