Bukalapak Javascript Toolkits
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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