|
@@ -73,3 +73,29 @@ hist(2)
|
|
plot(2)
|
|
plot(2)
|
|
```
|
|
```
|
|
|
|
|
|
|
|
+### Get javascript to filter Market
|
|
|
|
+```python
|
|
|
|
+from datetime import datetime
|
|
|
|
+from db import PlayerDB
|
|
|
|
+from tinydb import Query
|
|
|
|
+import json
|
|
|
|
+today=datetime.utcnow().strftime('%Y-%m-%d')
|
|
|
|
+Cards=PlayerDB.search(Query().fragment({'date':today}))
|
|
|
|
+clist=[None]*152
|
|
|
|
+for card in Cards: clist[card['card-num']]=card['stock']
|
|
|
|
+
|
|
|
|
+js="clist={clist}\n".format(clist=json.dumps(clist))
|
|
|
|
+js+="""
|
|
|
|
+cards=document.getElementsByClassName('wrapper-market-card')
|
|
|
|
+for (var i = 0; i < cards.length; i++) {
|
|
|
|
+ cardNum = cards.item(i).getElementsByClassName('pornstar-number')[0].outerText;
|
|
|
|
+ innerCard = cards.item(i).getElementsByClassName('inner-market-card')[0]
|
|
|
|
+ let qty = document.createElement('div');
|
|
|
|
+ qty.innerText = "Stock: " + clist[cardNum]
|
|
|
|
+ innerCard.appendChild(qty)
|
|
|
|
+ if (clist[cardNum].includes('CRYSTAL')){
|
|
|
|
+ cards.item(i).style.setProperty('Display','None');
|
|
|
|
+ }
|
|
|
|
+}"""
|
|
|
|
+print(js)
|
|
|
|
+```
|