-
Notifications
You must be signed in to change notification settings - Fork 0
/
offer-bookmarklet.js
1 lines (1 loc) · 5.65 KB
/
offer-bookmarklet.js
1
javascript:(()%3D%3E%7B!function()%7Blet%20e%3Ddocument.createElement(%22div%22)%3Be.innerHTML%3D'%3Cdiv%20id%3D%22overlay%22%20style%3D%22position%3A%20fixed%3B%20background-color%3A%20rgba(0%2C0%2C0%2C.9)%3B%20top%3A%200%3B%20bottom%3A%200%3B%20left%3A%200%3B%20right%3A%200%3B%20z-index%3A%20999%3B%20height%3A100wh%3B%20color%3A%20white%3B%20font-size%3A%202em%3B%20margin%3A%20auto%3B%20padding%3A%20auto%3B%20padding-top%3A1em%3B%22%3E%5Cn%20%20%20%20%20%20%20%20%3Cdiv%20id%3D%22container%22%20style%3D%22background%3A%20rgba(0%2C0%2C0%2C.5)%3B%20color%3A%20white%3B%20width%3A%2090vw%3B%20height%3A%2090vh%3B%20padding%3A%201em%3B%20border-radius%3A%20.5em%3B%20margin%3A%20auto%3B%20align-items%3A%20center%3B%22%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Clabel%3E%3Cspan%20style%3D%22display%3Aflex%3B%22%3EDefault%20Offer%20Price%3C%2Fspan%3E%3Cinput%20type%3D%22number%22%20id%3D%22price%22%20value%3D%221%22%3E%3C%2Flabel%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Clabel%3E%3Cspan%20style%3D%22display%3Aflex%3B%22%3ENames%3C%2Fspan%3E%3Ctextarea%20id%3D%22input%22%20style%3D%22width%3A100%25%3B%20height%3A%2050vh%3B%22%3E%3C%2Ftextarea%3E%3C%2Flabel%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3Cdiv%20style%3D%22margin-top%3A.5em%3B%22%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cbutton%20id%3D%22cancel%22%3ECancel%3C%2Fbutton%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Cbutton%20id%3D%22submit%22%3ESubmit%3C%2Fbutton%3E%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%3C%2Fdiv%3E%5Cn%20%20%20%20%3C%2Fdiv%3E'%2Cdocument.body.appendChild(e)%3Blet%20t%3Ddocument.getElementById(%22price%22)%2Cn%3Ddocument.getElementById(%22input%22)%2Ci%3Ddocument.getElementById(%22cancel%22)%2Co%3Ddocument.getElementById(%22submit%22)%3Bfunction%20a(e%2Ct)%7Breturn%20fetch(%22https%3A%2F%2Fwww.namebase.io%2Fapi%2Fv0%2Fmarketplace%2F%22%2Be%2B%22%2Fbid%22%2C%7Bcredentials%3A%22include%22%2Cheaders%3A%7BAccept%3A%22application%2Fjson%22%2C%22Content-Type%22%3A%22application%2Fjson%22%7D%2Cbody%3A'%7B%22buyOfferAmount%22%3A%22'%2Bt%2B'%22%7D'%2Cmethod%3A%22POST%22%7D)%7Di.onclick%3D()%3D%3Ee.remove()%2Co.onclick%3D()%3D%3Efunction()%7Blet%20i%3DparseFloat(t.value)%7C%7C0%2Co%3Dn.value.replace(%2F%5Cr%2Fg%2C%22%22).split(%22%5Cn%22).map((e%3D%3E%7B(e%3De.toLowerCase().replace(%2F%5C(%5B%5E)%5D*%5C)%2Fg%2C%22%22)).startsWith(%22https%3A%2F%2Fwww.namebase.io%2Fdomains%2F%22)%26%26(e%3De.substring(%22https%3A%2F%2Fwww.namebase.io%2Fdomains%2F%22.length))%2Ce.startsWith(%22counteroffer%20for%22)%26%26(e%3De.substring(%22counteroffer%20for%22.length))%2Ce.endsWith(%22.eml%22)%26%26(e%3De.substring(0%2Ce.length-%22.eml%22.length))%2Ce.endsWith(%22is%20now%20available%20for%20purchase%22)%26%26(e%3De.substring(0%2Ce.length-%22is%20now%20available%20for%20purchase%22.length))%3Bconst%20t%3D%5B%22hns%22%2C%22buy%20now%22%2C%22filters%22%2C%22accepts%20offers%22%2C%22min%20price%22%2C%22max%20price%22%2C%22min%20length%22%2C%22max%20length%22%2C%22starts%20with%22%2C%22ends%20with%22%2C%22prev%22%2C%22next%22%2C%22dashboard%22%2C%22marketplace%22%2C%22auctions%22%2C%22support%22%2C%22all%22%2C%22for%20sale%22%2C%22sold%22%2C%22search%20for%20domains%22%2C%22sort%20by%22%2C%22newly%20listed%22%2C%22bulk%20search%22%2C%22price%22%2C%2226k%22%2C%2229k%22%2C%22domain%22%5D%2Cn%3D%5B%22%20hns%22%2C%22exclude%20%22%5D%3Bif(!e%7C%7Ce.length%3C%3D2%7C%7Ct.some((t%3D%3Ee%3D%3D%3Dt))%7C%7Cn.some((t%3D%3Ee.includes(t))))return%20null%3Blet%5Bo%2Ca%5D%3De.includes(%22%2C%22)%3Fe.split(%22%2C%22)%3A%5Be.trim()%2Ci%5D%3Breturn%20e%3De.trim()%2C%7Bname%3Ao%2Camount%3AparseFloat(a)%2Csent%3A!1%7D%7D)).filter(Boolean)%3Be.remove()%3Blet%20l%3Ddocument.createElement(%22div%22)%3Bl.innerHTML%3D'%3Cdiv%20id%3D%22overlay%22%20style%3D%22position%3A%20fixed%3B%20background-color%3A%20rgba(0%2C0%2C0%2C.9)%3B%20top%3A%200%3B%20bottom%3A%200%3B%20left%3A%200%3B%20right%3A%200%3B%20z-index%3A%20999%3B%20height%3A100wh%3B%20justify-content%3A%20center%3B%20align-items%3A%20center%3B%20color%3A%20white%3B%20font-size%3A%202em%3B%22%3E%5Cn%20%20%20%20%20%20%20%20%3Cdiv%20id%3D%22container%22%20style%3D%22background%3A%20rgba(0%2C0%2C0%2C.6)%3B%20color%3A%20white%3B%20width%3A%2090vw%3B%20height%3A%2090vh%3B%20padding%3A%201em%3B%20border-radius%3A%20.5em%3B%20margin%3A%20auto%3B%20text-align%3A%20center%3B%20padding-top%3A33vh%3B%22%3E%5Cn%20%20%20%20%20%20%20%20%3Cdiv%3E%F0%9F%A4%9DHandshake%3DRoot%F0%9F%AB%9A%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%3Cdiv%20id%3D%22current-name%22%3E%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%3Cdiv%20id%3D%22progress%22%3E0.00%25%3C%2Fdiv%3E%5Cn%20%20%20%20%20%20%20%20%3Cbutton%20id%3D%22cancel%22%3ECancel%3C%2Fbutton%3E%3C%2Fdiv%3E%3C%2Fdiv%3E'%2Cdocument.body.appendChild(l)%2Cdocument.getElementById(%22cancel%22).onclick%3D()%3D%3El.remove()%3Blet%20r%3D10%2Cd%3D0%2Cs%3D1e3%2F3%2Cc%3D%5B%5D%3Basync%20function%20m()%7Blet%20e%3Do.slice(d%2Cd%2Br)%2Ct%3D%5B%5D%3Bfor(let%20n%20of%20e)if(!n.sent)%7Bdocument.getElementById(%22current-name%22).innerText%3D%22Sending%3A%20%22%2Bn.name%3Blet%20e%3Da(n.name%2Cn.amount).then((()%3D%3En.sent%3D!0)).catch((()%3D%3Ec.push(n.name)))%3Bt.push(e)%7Dawait%20Promise.all(t)%2Cd%2B%3Dr%3Blet%20n%3D(d%2Fo.length*100).toFixed(2)%3Bif(document.getElementById(%22progress%22).innerText%3Dn%2B%22%25%22%2Cd%3Co.length)setTimeout(m%2Cs)%3Belse%20if(l.remove()%2Cc.length%3E0)%7Blet%20e%3Dc.join(%22%2C%20%22)%3Balert(%22Error%20submitting%20offers%20for%20names%3A%20%22%2Be)%7D%7Dm()%7D()%7D()%3B%7D)()%3B