Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Bukalapak Javascript Toolkits
// Script ini berfungsi untuk menghitung semua "Barang Favorit" kalian. Steps:
// 1. Login
// 2. Buka halaman: https://www.bukalapak.com/bookmarks
// 3. Checklist barang-barang yang ingin kalian hitung
// 4. Buka JS console
// 5. Jalankan script di bawah
[...document.querySelectorAll(".c-inp--checkbox:checked")]
.map(el =>
parseInt(
(
el
.closest(".c-card--grid")
.querySelector(".c-card__product-price--reduced") ||
el.closest(".c-card--grid").querySelector(".c-card__product-price")
).textContent.replace(/[^0-9]/g, ""),
10
)
)
.reduce((a, c) => a + c, 1400000)
.toLocaleString("en-ID", {
style: "currency",
currency: "IDR"
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment