PageSourceSearch

https://www.lazylama.nl/cdn/shop/t/4/assets/kiyoh-score.js?v=34646591649984797681790600883

js lazylama.nl collected 2026-10-07 18:55:55 UTC 2,524 bytes, 2 lines download raw bytes

1(function(){const scoreElements=document.querySelectorAll("[data-kiyoh-score]"),countElements=document.querySelectorAll("[data-kiyoh-count]");if(!scoreElements.length&&!countElements.length)return;const locationId=document.currentScript?.dataset.kiyohLocation||"1046008",cacheKey=`kiyoh-rating-${locationId}`,cacheTtl=1440*60*1e3,requestTimeout=4e3,isValidScore=value=>{if(!/^(10(?:[.,]0)?|[1-9](?:[.,]\d)?)$/.exec(value))return!1;const normalized=parseFloat(value.replace(",","."));return normalized>=1&&normalized<=10},isValidCount=value=>/^[1-9]\d*$/.test(value),rawCountPattern=/^(\d+|\d{1,3}(?:[.,\s]\d{3})+)\s+\S+$/,applyValues=(score,count)=>{scoreElements.forEach(element=>{element.textContent=score}),countElements.forEach(element=>{element.textContent=count})},readCache=()=>{try{const raw=localStorage.getItem(cacheKey);if(!raw)return null;const cached2=JSON.parse(raw);if(!cached2||typeof cached2.score!="string"||typeof cached2.count!="string"||typeof cached2.timestamp!="number")return null;const age=Date.now()-cached2.timestamp;return!isValidScore(cached2.score)||!isValidCount(cached2.count)||!Number.isFinite(cached2.timestamp)||age<0||age>=cacheTtl?null:cached2}catch{return null}},writeCache=(score,count)=>{try{localStorage.setItem(cacheKey,JSON.stringify({score,count,timestamp:Date.now()}))}catch{}},cached=readCache();if(cached){applyValues(cached.score,cached.count);return}const controller=new AbortController,timeoutId=setTimeout(()=>controller.abort(),requestTimeout),widgetUrl="https://www.kiyoh.com/retrieve-widget.html?color=white&allowTransparency=false&button=false&lang=nl&tenantId=98&locationId="+encodeURIComponent(locationId);fetch(widgetUrl,{signal:controller.signal}).then(response=>{if(!response.ok)throw new Error("Kiyoh widget request failed");return response.text()}).then(html=>{const doc=new DOMParser().parseFromString(html,"text/html"),scoreElement=doc.querySelector(".rating"),countElement=doc.querySelector(".review-count");if(!scoreElement||!countElement)return;const score=scoreElement.textContent.trim(),rawCount=countElement.textContent.trim(),countMatch=rawCountPattern.exec(rawCount);if(!countMatch)return;const count=countMatch[1].replace(/[.,\s]/g,"");if(!isValidScore(score)||!isValidCount(count))return;const formattedScore=score.replace(".",",");applyValues(formattedScore,count),writeCache(formattedScore,count)}).catch(()=>{}).finally(()=>clearTimeout(timeoutId))})();
2//# sourceMappingURL=/cdn/shop/t/4/assets/kiyoh-score.js.map?v=34646591649984797681790600883

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.