Last active
April 2, 2020 17:07
-
-
Save krisanalfa/af45a313ad5477699544bc2bdb6d9233 to your computer and use it in GitHub Desktop.
Bukalapak Javascript Toolkits
This file contains hidden or 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