Преглед изворни кода

Added Play Page number for sale by you

KeyMasterOfGozer пре 7 месеци
родитељ
комит
4c22beaa04
1 измењених фајлова са 47 додато и 3 уклоњено
  1. 47 3
      README.md

+ 47 - 3
README.md

@@ -230,12 +230,13 @@ for (var i = 0; i < cards.length; i++) {
         stock = parseInt(cards.item(i).getElementsByClassName('nb-label')[0].outerText.trim());
         var fuzed = cards.item(i).getElementsByClassName('nb-name')[0];
         if (fuzed){stock = stock + 1;}
+        HTMLText = "Price: " + price;
         var priceDiv = cardNB.getElementsByClassName('Price')[0];
-        if (priceDiv){priceDiv.innerText = "Price: " + price;}
+        if (priceDiv){priceDiv.innerText = HTMLText;}
         else{
             let qty = document.createElement('div');
             qty.classList.add('Price');
-            qty.innerText = "Price: " + price;
+            qty.innerText = HTMLText;
             cardNB.appendChild(qty);
         }
     }catch(err){stock=0;}}else{
@@ -303,7 +304,50 @@ for (var i = 0; i < cards.length; i++) {
         cards.item(i).style.setProperty('Display','None');
     }
     if (clist[cardNum] < sellThreshold[cardVal.toString()]){
-        cards.item(i).style.setProperty('Display','None');
+        //cards.item(i).style.setProperty('Display','None');
     }
 }
 ```
+
+
+### javascript to show number cards for sale
+```javascript
+numForSale=[];
+for (var i = 0; i < 153; i++) {numForSale.push(0);}
+let marketSelling = document.createElement('div');
+marketSelling.id = 'market';
+marketSelling.innerHTML=await (await fetch('https://play.boobylegends.com/market/?tab=selling')).text();
+marketCards=marketSelling.getElementsByClassName('wrapper-market-card');
+for (var i = 0; i < marketCards.length; i++) {
+    try{
+    cardNum = parseInt(marketCards.item(i).getElementsByClassName('pornstar-number')[0].innerText);
+    price = parseInt(marketCards.item(i).getElementsByClassName('cost')[0].innerText.trim());
+    numForSale[cardNum]=numForSale[cardNum]+1;
+    }catch(err){console.log('error on '+cardNum.toString());}
+};
+cards=document.getElementsByClassName('wrapper-card');
+for (var i = 0; i < cards.length; i++) {
+    cardNum = parseInt(cards.item(i).getElementsByClassName('pornstar-number')[0].outerText);
+    cardVal = parseInt(cards.item(i).getElementsByClassName('score-card')[0].outerText);
+    if (numForSale[cardNum] > 0){
+        HTMLText = " +" + numForSale[cardNum];
+    }else{HTMLText=""}
+    var cardNB = cards.item(i).getElementsByClassName('card-nb')[0];
+    if (cardNB){try{
+        var priceDiv = cardNB.getElementsByClassName('Price')[0];
+        if (priceDiv){priceDiv.innerText = HTMLText;}
+        else{
+            let qty = document.createElement('div');
+            qty.classList.add('Price');
+            qty.innerText = HTMLText;
+            cardNB.appendChild(qty);
+        }
+    }catch(err){stock=0;}}else{
+        stock=0;
+    }
+}
+```
+
+
+
+