Le bookmarklet vous permet d'ajouter un Stand à StandBuy en un tap depuis n'importe quel site, sans quitter votre navigateur.
javascript:(function(){ (function (root) { 'use strict'; function guessCategory(name, url) { var text = ((name || '') + ' ' + (url || '')).toLowerCase(); if (/livre|\bbook|\broman\b|\bbd\b|manga|\bcd\b|vinyl|music/.test(text)) return 'Culture'; if (/veste|robe|\bjeans?\b|chaussure|\bsac|vetement|\bpull|manteau|t[- ]?shirt|tee[- ]?shirt|\bshirts?\b|d[ée]bardeur|chemis|pantalon|\bpants?\b|trousers|\bshorts?\b|bermuda|\bjupe|jupon|\bskirts?\b|parka|blouson|doudoune|anorak|\bgilet|cardigan|\bsweat|hoodie|sweater|pull[- ]?over|jacket|\bcoats?\b|chaussettes?|\bsocks?\b|collants?|leggings?|culotte|cale[çc]on|\bslips?\b|\bstring\b|\bboxers?\b|\bbriefs?\b|\bthongs?\b|panties|underwear|soutien[- ]?gorge|brassi[èe]re|lingerie|sous[- ]?v[êe]tement|pyjama|pajama|peignoir|maillot|bikini|swimsuit|swimwear|combinaison|salopette|dungarees|jogging|surv[êe]tement|[ée]charpe|scarf|foulard|\bgants?\b|gloves?|bonnet|casquette|\bhats?\b|chapeau|\bcapes?\b|poncho|kimono|tunique|tunic|\bpolos?\b|cravate|ceinture|\bbelts?\b|\bbottes?\b|\bboots?\b|\bbaskets?\b|sneakers?|mocassin|escarpin|sandale?s?|\btongs?\b|espadrille|blazer|\bvests?\b|\bsuits?\b|\bshoes?\b|\bdress(es)?\b|zara|h&m|hm\.com|uniqlo|sezane|asos|\bmango\b|bershka|kiabi|primark|shein|vinted|celio|jules|lacoste|levis|hilfiger|calvin|\blauren\b|dior|herm[èe]s|vuitton|gucci|prada|chanel|balenciaga|versace|givenchy|burberry|valentino|balmain|celine|moncler|armani/.test(text)) return 'Mode'; if (/lampe|canap[ée]|deco|meuble|ikea|maison|coussin|tapis/.test(text)) return 'Déco'; if (/plante|jardin|graine|arrosoir|\bpots?\b|fleur|truffaut|gamm.?vert/.test(text)) return 'Jardinage'; if (/iphone|ipad|macbook|airpods|apple|samsung|sony|philips|bose|jbl|sennheiser|sonos|razer|asus|lenovo|\bdell\b|nikon|gopro|xiaomi|huawei|oneplus|nintendo|playstation|xbox|nvidia|panasonic|garmin|anker|laptop|clavier|souris|tech|darty|ordinateur/.test(text)) return 'Tech'; if (/sport|v[ée]los?\b|raquette|nike|adidas|running|yoga|fitness/.test(text)) return 'Sport'; if (/cuisine|casserole|poele|couteau|cook|kitchen/.test(text)) return 'Cuisine'; if (/parfum|creme|s[ée]rum|\bsoins?\b|beaute|makeup|maquillage/.test(text)) return 'Beauté'; if (/voyage|valise|hotel|airbnb|avion|travel/.test(text)) return 'Voyage'; if (/lego|\bjeux?\b|\bdice\b|figurine|gaming/.test(text)) return 'Loisirs'; if (/restaurant|\bsorties?\b|concert|spectacle|theatre/.test(text)) return 'Sorties'; if (/bijou|joaillerie|collier|bracelet|pendentif|gourmette|chevali[èe]re|alliance|boucle d.oreille|diamant|saphir|rubis|jewel|necklace|earring|bagues?\b/.test(text)) return 'Bijoux'; if (/\bmontres?\b|watch|zenith|rolex|tissot|\boris\b|iwc/.test(text)) return 'Montres'; if (/bricolage|outil|leroy|castorama/.test(text)) return 'Bricolage'; if (/livre|\broman\b|\bbook/.test(text)) return 'Livres'; return 'Autre'; } function parsePrice(raw) { if (raw == null) return NaN; var s = String(raw); var m = s.match(/\d{1,3}(?:[ \u00a0\u202f.,]\d{3})+(?:[.,]\d{1,2})?|\d+(?:[.,]\d+)?/); if (!m) return NaN; var tok = m[0].replace(/[ \u00a0\u202f]/g, ''); var hasDot = tok.indexOf('.') !== -1; var hasComma = tok.indexOf(',') !== -1; if (hasDot && hasComma) { if (tok.lastIndexOf(',') > tok.lastIndexOf('.')) { tok = tok.replace(/\./g, '').replace(',', '.'); } else { tok = tok.replace(/,/g, ''); } } else if (hasComma) { var pc = tok.split(','); tok = (pc.length === 2 && pc[1].length <= 2) ? pc[0] + '.' + pc[1] : tok.replace(/,/g, ''); } else if (hasDot) { var pd = tok.split('.'); if (pd.length > 2 || (pd[1] && pd[1].length === 3)) tok = tok.replace(/\./g, ''); } return parseFloat(tok); } function priceStr(raw) { var n = parsePrice(raw); if (isNaN(n) || n <= 0 || n >= 1000000) return ''; return String(Math.round(n * 100) / 100); } function collectLd() { var out = []; var scripts = document.querySelectorAll('script[type="application/ld+json"]'); for (var i = 0; i < scripts.length; i++) { try { out.push(JSON.parse(scripts[i].textContent || scripts[i].innerText || 'null')); } catch (e) {} } return out; } function findProduct(node, depth) { if (!node || typeof node !== 'object' || depth > 6) return null; if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var r = findProduct(node[i], depth + 1); if (r) return r; } return null; } var type = node['@type']; var isProduct = type === 'Product' || (Array.isArray(type) && type.indexOf('Product') !== -1); if (isProduct && (node.offers || node.name)) return node; if (node['@graph']) { var g = findProduct(node['@graph'], depth + 1); if (g) return g; } return null; } var SUPPORTED_CUR = { EUR: 1, USD: 1, GBP: 1, CHF: 1, JPY: 1, CAD: 1, AUD: 1 }; function normCurrency(code) { if (!code) return ''; code = String(code).trim().toUpperCase(); return SUPPORTED_CUR[code] ? code : ''; } function detectCurrency(str) { if (!str) return ''; var s = String(str).toUpperCase(); var m = s.match(/\b(EUR|USD|GBP|CHF|JPY|CAD|AUD)\b/); if (m) return m[1]; if (s.indexOf('€') !== -1) return 'EUR'; if (s.indexOf('£') !== -1) return 'GBP'; if (s.indexOf('CHF') !== -1) return 'CHF'; if (s.indexOf('¥') !== -1) return 'JPY'; if (s.indexOf('CA$') !== -1) return 'CAD'; if (s.indexOf('A$') !== -1) return 'AUD'; if (s.indexOf('US$') !== -1 || s.indexOf('$') !== -1) return 'USD'; return ''; } function ldPrice(product) { var none = { price: '', currency: '' }; if (!product) return none; var offers = product.offers; if (!offers) return none; var list = Array.isArray(offers) ? offers : [offers]; for (var i = 0; i < list.length; i++) { var o = list[i] || {}; var cand = o.price; var cur = o.priceCurrency; if (cand == null && o.priceSpecification) { var ps = Array.isArray(o.priceSpecification) ? o.priceSpecification[0] : o.priceSpecification; if (ps) { cand = ps.price; cur = cur || ps.priceCurrency; } } if (cand == null) cand = o.lowPrice; var p = priceStr(cand); if (p) return { price: p, currency: normCurrency(cur) }; } if (offers.lowPrice != null) { var pl = priceStr(offers.lowPrice); if (pl) return { price: pl, currency: normCurrency(offers.priceCurrency) }; } return none; } function ldImage(product) { if (!product || !product.image) return ''; var img = product.image; if (Array.isArray(img)) img = img[0]; if (img && typeof img === 'object') img = img.url || img['@id'] || ''; return (typeof img === 'string' && img.indexOf('http') === 0) ? img : ''; } function metaPrice() { var none = { price: '', currency: '' }; var sel = ['meta[property="product:price:amount"]', 'meta[property="og:price:amount"]', 'meta[name="og:price:amount"]', 'meta[itemprop="price"]', 'meta[name="twitter:data1"]']; for (var i = 0; i < sel.length; i++) { var el = document.querySelector(sel[i]); if (el && el.content) { var p = priceStr(el.content); if (p) { var cur = metaContent('meta[property="product:price:currency"]') || metaContent('meta[property="og:price:currency"], meta[name="og:price:currency"]') || metaContent('meta[itemprop="priceCurrency"]'); return { price: p, currency: normCurrency(cur) || detectCurrency(el.content) }; } } } return none; } function microdataPrice() { var none = { price: '', currency: '' }; var els = document.querySelectorAll('[itemprop="price"]'); for (var i = 0; i < els.length; i++) { var raw = els[i].getAttribute('content') || els[i].getAttribute('data-price') || els[i].textContent; var p = priceStr(raw); if (p) { var curEl = document.querySelector('[itemprop="priceCurrency"]'); var cur = curEl ? (curEl.getAttribute('content') || curEl.textContent) : ''; return { price: p, currency: normCurrency(cur) || detectCurrency(raw) }; } } return none; } function isStrikethrough(el) { var cls = (el.className && el.className.toString ? el.className.toString() : '').toLowerCase(); if (/old|strike|barr|was|regular|previous|crossed|reduc|line-through/.test(cls)) return true; var tag = (el.tagName || '').toUpperCase(); if (tag === 'DEL' || tag === 'S' || tag === 'STRIKE') return true; if (el.closest && el.closest('del, s, strike')) return true; return false; } function amazonPrice() { var none = { price: '', currency: '' }; var offs; try { offs = document.querySelectorAll('.a-offscreen'); } catch (e) { return none; } if (!offs.length) return none; var best = null; for (var i = 0; i < offs.length; i++) { var el = offs[i]; var ap = el.closest ? el.closest('.a-price') : null; if (!ap) continue; if (isStrikethrough(el) || isStrikethrough(ap)) continue; var raw = (el.textContent || '').trim(); var p = priceStr(raw); if (!p) continue; var cand = { price: p, currency: detectCurrency(raw) }; var color = (ap.getAttribute('data-a-color') || '').toLowerCase(); var ctx = ((ap.className || '') + ' ' + ((ap.parentNode && ap.parentNode.className) || '')).toString(); var isList = color === 'secondary' || /a-text-price|basisPrice|listPrice/i.test(ctx); var isSale = color === 'base' || /priceToPay|apexPriceToPay|priceblock_(our|deal|sale)price/i.test(ctx); if (isSale && !isList) return cand; if (!best && !isList) best = cand; if (!best) best = cand; } return best || none; } function domPrice() { var selectors = ['[data-price]', '[itemprop="price"]', '[class*="price" i]', '[class*="Prix" i]', '[id*="price" i]', '.product-price', '.offer-price', '.a-price .a-offscreen']; for (var i = 0; i < selectors.length; i++) { var els; try { els = document.querySelectorAll(selectors[i]); } catch (e) { continue; } for (var j = 0; j < els.length; j++) { var el = els[j]; if (isStrikethrough(el)) continue; var raw = el.getAttribute('content') || el.getAttribute('data-price') || el.innerText || el.textContent || ''; var p = priceStr(raw); if (p) return { price: p, currency: detectCurrency(raw) }; } } return { price: '', currency: '' }; } function textScanPrice() { var none = { price: '', currency: '' }; var els; try { els = document.querySelectorAll('span, b, strong, bdi, ins, dd, div, p, h2, h3'); } catch (e) { return none; } for (var i = 0; i < els.length; i++) { var el = els[i]; var txt = (el.textContent || '').replace(/\s+/g, ' ').trim(); if (!txt || txt.length > 24) continue; if (/[%]/.test(txt) || /^[-−–]/.test(txt)) continue; var cur = detectCurrency(txt); if (!cur) continue; var rest = txt.replace(/[€$£¥]/g, '') .replace(/\b(?:EUR|USD|GBP|CHF|JPY|CAD|AUD)\b/gi, '') .replace(/[\d\s.,'’\-]/g, '').trim(); if (rest.length > 0) continue; if (isStrikethrough(el)) continue; var p = priceStr(txt); if (p) return { price: p, currency: cur }; } return none; } function reconcile(r) { var n = parseFloat(r.price); if (isNaN(n) || n % 1 !== 0) return r; var t = textScanPrice(); if (t.price) { var tn = parseFloat(t.price); if (!isNaN(tn) && tn % 1 !== 0 && Math.abs(n / 100 - tn) < 0.005) { return { price: t.price, currency: r.currency || t.currency }; } } return r; } function extractPrice(product) { var r = amazonPrice(); if (r.price) return r; r = ldPrice(product); if (r.price) return reconcile(r); r = metaPrice(); if (r.price) return reconcile(r); r = microdataPrice(); if (r.price) return reconcile(r); r = domPrice(); if (r.price) return r; return textScanPrice(); } function metaContent(selector) { var el = document.querySelector(selector); return (el && el.content) ? el.content : ''; } function extractName(product) { var name = (product && typeof product.name === 'string' && product.name) || metaContent('meta[property="og:title"], meta[name="og:title"]') || (document.querySelector('h1') || {}).innerText || metaContent('meta[name="twitter:title"]') || document.title || ''; return String(name || '').replace(/\s+/g, ' ').trim(); } function normalizeImageUrl(url) { if (!url) return url; if (/\/[a-z]{1,3}_[^/]+(?:,[a-z]{1,3}_[^/]+)+\ url = url.replace(/\/d_[^/]+\.(?:gif|png|jpe?g|webp)(?=\/)/i, ''); } return url; } function extractImages(product) { var imgs = []; function add(src) { src = normalizeImageUrl(src); if (src && src.indexOf('http') === 0 && imgs.indexOf(src) === -1) imgs.push(src); } add(ldImage(product)); add(metaContent('meta[property="og:image"], meta[name="og:image"]')); add(metaContent('meta[name="twitter:image"]')); var imgEls = document.querySelectorAll('[class*="product"] img, [class*="gallery"] img, main img'); for (var j = 0; j < imgEls.length && imgs.length < 6; j++) { add(imgEls[j].getAttribute('data-src') || imgEls[j].getAttribute('data-lazy-src') || imgEls[j].src); } return imgs; } function scrapePageData() { var product = null; try { var lds = collectLd(); for (var i = 0; i < lds.length && !product; i++) product = findProduct(lds[i], 0); } catch (e) {} var name = extractName(product); var price = '', currency = ''; try { var pr = extractPrice(product); price = pr.price; currency = pr.currency; } catch (e) {} var imgs = extractImages(product); return { name: name.substring(0, 120), price: price, currency: currency, imgs: imgs, img: imgs[0] || '' }; } root.SBScraper = { scrapePageData: scrapePageData, guessCategory: guessCategory, parsePrice: parsePrice, detectCurrency: detectCurrency }; })(typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : this)); var d=window.SBScraper.scrapePageData(); window.open('https://standbuy.app?add=1&name='+encodeURIComponent(d.name||'')+'&url='+encodeURIComponent(location.href)+'&img='+encodeURIComponent(d.img||'')+'&price='+encodeURIComponent(d.price||'')+'¤cy='+encodeURIComponent(d.currency||''),'_blank'); })();
StandBuy permet de partager des stands avec d'autres utilisateurs. Pour garder un environnement sûr, vous pouvez bloquer et signaler à tout moment.
The bookmarklet lets you add a Stand to StandBuy with one tap from any website, without leaving your browser.
javascript:(function(){ (function (root) { 'use strict'; function guessCategory(name, url) { var text = ((name || '') + ' ' + (url || '')).toLowerCase(); if (/livre|\bbook|\broman\b|\bbd\b|manga|\bcd\b|vinyl|music/.test(text)) return 'Culture'; if (/veste|robe|\bjeans?\b|chaussure|\bsac|vetement|\bpull|manteau|t[- ]?shirt|tee[- ]?shirt|\bshirts?\b|d[ée]bardeur|chemis|pantalon|\bpants?\b|trousers|\bshorts?\b|bermuda|\bjupe|jupon|\bskirts?\b|parka|blouson|doudoune|anorak|\bgilet|cardigan|\bsweat|hoodie|sweater|pull[- ]?over|jacket|\bcoats?\b|chaussettes?|\bsocks?\b|collants?|leggings?|culotte|cale[çc]on|\bslips?\b|\bstring\b|\bboxers?\b|\bbriefs?\b|\bthongs?\b|panties|underwear|soutien[- ]?gorge|brassi[èe]re|lingerie|sous[- ]?v[êe]tement|pyjama|pajama|peignoir|maillot|bikini|swimsuit|swimwear|combinaison|salopette|dungarees|jogging|surv[êe]tement|[ée]charpe|scarf|foulard|\bgants?\b|gloves?|bonnet|casquette|\bhats?\b|chapeau|\bcapes?\b|poncho|kimono|tunique|tunic|\bpolos?\b|cravate|ceinture|\bbelts?\b|\bbottes?\b|\bboots?\b|\bbaskets?\b|sneakers?|mocassin|escarpin|sandale?s?|\btongs?\b|espadrille|blazer|\bvests?\b|\bsuits?\b|\bshoes?\b|\bdress(es)?\b|zara|h&m|hm\.com|uniqlo|sezane|asos|\bmango\b|bershka|kiabi|primark|shein|vinted|celio|jules|lacoste|levis|hilfiger|calvin|\blauren\b|dior|herm[èe]s|vuitton|gucci|prada|chanel|balenciaga|versace|givenchy|burberry|valentino|balmain|celine|moncler|armani/.test(text)) return 'Mode'; if (/lampe|canap[ée]|deco|meuble|ikea|maison|coussin|tapis/.test(text)) return 'Déco'; if (/plante|jardin|graine|arrosoir|\bpots?\b|fleur|truffaut|gamm.?vert/.test(text)) return 'Jardinage'; if (/iphone|ipad|macbook|airpods|apple|samsung|sony|philips|bose|jbl|sennheiser|sonos|razer|asus|lenovo|\bdell\b|nikon|gopro|xiaomi|huawei|oneplus|nintendo|playstation|xbox|nvidia|panasonic|garmin|anker|laptop|clavier|souris|tech|darty|ordinateur/.test(text)) return 'Tech'; if (/sport|v[ée]los?\b|raquette|nike|adidas|running|yoga|fitness/.test(text)) return 'Sport'; if (/cuisine|casserole|poele|couteau|cook|kitchen/.test(text)) return 'Cuisine'; if (/parfum|creme|s[ée]rum|\bsoins?\b|beaute|makeup|maquillage/.test(text)) return 'Beauté'; if (/voyage|valise|hotel|airbnb|avion|travel/.test(text)) return 'Voyage'; if (/lego|\bjeux?\b|\bdice\b|figurine|gaming/.test(text)) return 'Loisirs'; if (/restaurant|\bsorties?\b|concert|spectacle|theatre/.test(text)) return 'Sorties'; if (/bijou|joaillerie|collier|bracelet|pendentif|gourmette|chevali[èe]re|alliance|boucle d.oreille|diamant|saphir|rubis|jewel|necklace|earring|bagues?\b/.test(text)) return 'Bijoux'; if (/\bmontres?\b|watch|zenith|rolex|tissot|\boris\b|iwc/.test(text)) return 'Montres'; if (/bricolage|outil|leroy|castorama/.test(text)) return 'Bricolage'; if (/livre|\broman\b|\bbook/.test(text)) return 'Livres'; return 'Autre'; } function parsePrice(raw) { if (raw == null) return NaN; var s = String(raw); var m = s.match(/\d{1,3}(?:[ \u00a0\u202f.,]\d{3})+(?:[.,]\d{1,2})?|\d+(?:[.,]\d+)?/); if (!m) return NaN; var tok = m[0].replace(/[ \u00a0\u202f]/g, ''); var hasDot = tok.indexOf('.') !== -1; var hasComma = tok.indexOf(',') !== -1; if (hasDot && hasComma) { if (tok.lastIndexOf(',') > tok.lastIndexOf('.')) { tok = tok.replace(/\./g, '').replace(',', '.'); } else { tok = tok.replace(/,/g, ''); } } else if (hasComma) { var pc = tok.split(','); tok = (pc.length === 2 && pc[1].length <= 2) ? pc[0] + '.' + pc[1] : tok.replace(/,/g, ''); } else if (hasDot) { var pd = tok.split('.'); if (pd.length > 2 || (pd[1] && pd[1].length === 3)) tok = tok.replace(/\./g, ''); } return parseFloat(tok); } function priceStr(raw) { var n = parsePrice(raw); if (isNaN(n) || n <= 0 || n >= 1000000) return ''; return String(Math.round(n * 100) / 100); } function collectLd() { var out = []; var scripts = document.querySelectorAll('script[type="application/ld+json"]'); for (var i = 0; i < scripts.length; i++) { try { out.push(JSON.parse(scripts[i].textContent || scripts[i].innerText || 'null')); } catch (e) {} } return out; } function findProduct(node, depth) { if (!node || typeof node !== 'object' || depth > 6) return null; if (Array.isArray(node)) { for (var i = 0; i < node.length; i++) { var r = findProduct(node[i], depth + 1); if (r) return r; } return null; } var type = node['@type']; var isProduct = type === 'Product' || (Array.isArray(type) && type.indexOf('Product') !== -1); if (isProduct && (node.offers || node.name)) return node; if (node['@graph']) { var g = findProduct(node['@graph'], depth + 1); if (g) return g; } return null; } var SUPPORTED_CUR = { EUR: 1, USD: 1, GBP: 1, CHF: 1, JPY: 1, CAD: 1, AUD: 1 }; function normCurrency(code) { if (!code) return ''; code = String(code).trim().toUpperCase(); return SUPPORTED_CUR[code] ? code : ''; } function detectCurrency(str) { if (!str) return ''; var s = String(str).toUpperCase(); var m = s.match(/\b(EUR|USD|GBP|CHF|JPY|CAD|AUD)\b/); if (m) return m[1]; if (s.indexOf('€') !== -1) return 'EUR'; if (s.indexOf('£') !== -1) return 'GBP'; if (s.indexOf('CHF') !== -1) return 'CHF'; if (s.indexOf('¥') !== -1) return 'JPY'; if (s.indexOf('CA$') !== -1) return 'CAD'; if (s.indexOf('A$') !== -1) return 'AUD'; if (s.indexOf('US$') !== -1 || s.indexOf('$') !== -1) return 'USD'; return ''; } function ldPrice(product) { var none = { price: '', currency: '' }; if (!product) return none; var offers = product.offers; if (!offers) return none; var list = Array.isArray(offers) ? offers : [offers]; for (var i = 0; i < list.length; i++) { var o = list[i] || {}; var cand = o.price; var cur = o.priceCurrency; if (cand == null && o.priceSpecification) { var ps = Array.isArray(o.priceSpecification) ? o.priceSpecification[0] : o.priceSpecification; if (ps) { cand = ps.price; cur = cur || ps.priceCurrency; } } if (cand == null) cand = o.lowPrice; var p = priceStr(cand); if (p) return { price: p, currency: normCurrency(cur) }; } if (offers.lowPrice != null) { var pl = priceStr(offers.lowPrice); if (pl) return { price: pl, currency: normCurrency(offers.priceCurrency) }; } return none; } function ldImage(product) { if (!product || !product.image) return ''; var img = product.image; if (Array.isArray(img)) img = img[0]; if (img && typeof img === 'object') img = img.url || img['@id'] || ''; return (typeof img === 'string' && img.indexOf('http') === 0) ? img : ''; } function metaPrice() { var none = { price: '', currency: '' }; var sel = ['meta[property="product:price:amount"]', 'meta[property="og:price:amount"]', 'meta[name="og:price:amount"]', 'meta[itemprop="price"]', 'meta[name="twitter:data1"]']; for (var i = 0; i < sel.length; i++) { var el = document.querySelector(sel[i]); if (el && el.content) { var p = priceStr(el.content); if (p) { var cur = metaContent('meta[property="product:price:currency"]') || metaContent('meta[property="og:price:currency"], meta[name="og:price:currency"]') || metaContent('meta[itemprop="priceCurrency"]'); return { price: p, currency: normCurrency(cur) || detectCurrency(el.content) }; } } } return none; } function microdataPrice() { var none = { price: '', currency: '' }; var els = document.querySelectorAll('[itemprop="price"]'); for (var i = 0; i < els.length; i++) { var raw = els[i].getAttribute('content') || els[i].getAttribute('data-price') || els[i].textContent; var p = priceStr(raw); if (p) { var curEl = document.querySelector('[itemprop="priceCurrency"]'); var cur = curEl ? (curEl.getAttribute('content') || curEl.textContent) : ''; return { price: p, currency: normCurrency(cur) || detectCurrency(raw) }; } } return none; } function isStrikethrough(el) { var cls = (el.className && el.className.toString ? el.className.toString() : '').toLowerCase(); if (/old|strike|barr|was|regular|previous|crossed|reduc|line-through/.test(cls)) return true; var tag = (el.tagName || '').toUpperCase(); if (tag === 'DEL' || tag === 'S' || tag === 'STRIKE') return true; if (el.closest && el.closest('del, s, strike')) return true; return false; } function amazonPrice() { var none = { price: '', currency: '' }; var offs; try { offs = document.querySelectorAll('.a-offscreen'); } catch (e) { return none; } if (!offs.length) return none; var best = null; for (var i = 0; i < offs.length; i++) { var el = offs[i]; var ap = el.closest ? el.closest('.a-price') : null; if (!ap) continue; if (isStrikethrough(el) || isStrikethrough(ap)) continue; var raw = (el.textContent || '').trim(); var p = priceStr(raw); if (!p) continue; var cand = { price: p, currency: detectCurrency(raw) }; var color = (ap.getAttribute('data-a-color') || '').toLowerCase(); var ctx = ((ap.className || '') + ' ' + ((ap.parentNode && ap.parentNode.className) || '')).toString(); var isList = color === 'secondary' || /a-text-price|basisPrice|listPrice/i.test(ctx); var isSale = color === 'base' || /priceToPay|apexPriceToPay|priceblock_(our|deal|sale)price/i.test(ctx); if (isSale && !isList) return cand; if (!best && !isList) best = cand; if (!best) best = cand; } return best || none; } function domPrice() { var selectors = ['[data-price]', '[itemprop="price"]', '[class*="price" i]', '[class*="Prix" i]', '[id*="price" i]', '.product-price', '.offer-price', '.a-price .a-offscreen']; for (var i = 0; i < selectors.length; i++) { var els; try { els = document.querySelectorAll(selectors[i]); } catch (e) { continue; } for (var j = 0; j < els.length; j++) { var el = els[j]; if (isStrikethrough(el)) continue; var raw = el.getAttribute('content') || el.getAttribute('data-price') || el.innerText || el.textContent || ''; var p = priceStr(raw); if (p) return { price: p, currency: detectCurrency(raw) }; } } return { price: '', currency: '' }; } function textScanPrice() { var none = { price: '', currency: '' }; var els; try { els = document.querySelectorAll('span, b, strong, bdi, ins, dd, div, p, h2, h3'); } catch (e) { return none; } for (var i = 0; i < els.length; i++) { var el = els[i]; var txt = (el.textContent || '').replace(/\s+/g, ' ').trim(); if (!txt || txt.length > 24) continue; if (/[%]/.test(txt) || /^[-−–]/.test(txt)) continue; var cur = detectCurrency(txt); if (!cur) continue; var rest = txt.replace(/[€$£¥]/g, '') .replace(/\b(?:EUR|USD|GBP|CHF|JPY|CAD|AUD)\b/gi, '') .replace(/[\d\s.,'’\-]/g, '').trim(); if (rest.length > 0) continue; if (isStrikethrough(el)) continue; var p = priceStr(txt); if (p) return { price: p, currency: cur }; } return none; } function reconcile(r) { var n = parseFloat(r.price); if (isNaN(n) || n % 1 !== 0) return r; var t = textScanPrice(); if (t.price) { var tn = parseFloat(t.price); if (!isNaN(tn) && tn % 1 !== 0 && Math.abs(n / 100 - tn) < 0.005) { return { price: t.price, currency: r.currency || t.currency }; } } return r; } function extractPrice(product) { var r = amazonPrice(); if (r.price) return r; r = ldPrice(product); if (r.price) return reconcile(r); r = metaPrice(); if (r.price) return reconcile(r); r = microdataPrice(); if (r.price) return reconcile(r); r = domPrice(); if (r.price) return r; return textScanPrice(); } function metaContent(selector) { var el = document.querySelector(selector); return (el && el.content) ? el.content : ''; } function extractName(product) { var name = (product && typeof product.name === 'string' && product.name) || metaContent('meta[property="og:title"], meta[name="og:title"]') || (document.querySelector('h1') || {}).innerText || metaContent('meta[name="twitter:title"]') || document.title || ''; return String(name || '').replace(/\s+/g, ' ').trim(); } function normalizeImageUrl(url) { if (!url) return url; if (/\/[a-z]{1,3}_[^/]+(?:,[a-z]{1,3}_[^/]+)+\ url = url.replace(/\/d_[^/]+\.(?:gif|png|jpe?g|webp)(?=\/)/i, ''); } return url; } function extractImages(product) { var imgs = []; function add(src) { src = normalizeImageUrl(src); if (src && src.indexOf('http') === 0 && imgs.indexOf(src) === -1) imgs.push(src); } add(ldImage(product)); add(metaContent('meta[property="og:image"], meta[name="og:image"]')); add(metaContent('meta[name="twitter:image"]')); var imgEls = document.querySelectorAll('[class*="product"] img, [class*="gallery"] img, main img'); for (var j = 0; j < imgEls.length && imgs.length < 6; j++) { add(imgEls[j].getAttribute('data-src') || imgEls[j].getAttribute('data-lazy-src') || imgEls[j].src); } return imgs; } function scrapePageData() { var product = null; try { var lds = collectLd(); for (var i = 0; i < lds.length && !product; i++) product = findProduct(lds[i], 0); } catch (e) {} var name = extractName(product); var price = '', currency = ''; try { var pr = extractPrice(product); price = pr.price; currency = pr.currency; } catch (e) {} var imgs = extractImages(product); return { name: name.substring(0, 120), price: price, currency: currency, imgs: imgs, img: imgs[0] || '' }; } root.SBScraper = { scrapePageData: scrapePageData, guessCategory: guessCategory, parsePrice: parsePrice, detectCurrency: detectCurrency }; })(typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : this)); var d=window.SBScraper.scrapePageData(); window.open('https://standbuy.app?add=1&name='+encodeURIComponent(d.name||'')+'&url='+encodeURIComponent(location.href)+'&img='+encodeURIComponent(d.img||'')+'&price='+encodeURIComponent(d.price||'')+'¤cy='+encodeURIComponent(d.currency||''),'_blank'); })();
StandBuy lets you share stands with other users. To keep things safe, you can block and report at any time.