Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (($) => {
- const prices = Array.from($('.suggested-price'));
- const items = [];
- prices.forEach(node => {
- const name = $(node).parents('.item-add-wear').parent().find('.market-name.market-link')[0].innerHTML;
- const price = parseFloat($(node).parents('.item-add-wear').find('.item-amount')[0].innerHTML.replace('$', '').replace(',', ''));
- const suggest = parseFloat(node.innerHTML.replace('$', '').replace(',', ''));
- const profit = suggest - price;
- const amount = 100 * (profit / price);
- items.push({
- name,
- price,
- profit,
- amount,
- });
- });
- items.sort((a, b) => b.amount - a.amount);
- console.log(items.filter(i => i.price < 500));
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement