相信有玩SteemMonster的朋友都會定期賣出卡片獲利。我一向都是使用 https://peakmonsters.com/ 來賣出卡片,不過缺點倒是有一個,就是缺少了一次過賣出所有卡片的功能。

▲ 共101張卡片,豈不是要點101次?
要賣出所有卡片的話,你只好逐個 "View Cards" 點一次,然後再選取每張卡片...

▲ 先點"View Cards",再逐張卡片點一次。
那實在太麻煩了吧?我找了一陣子,心想應該是有一個 "Select All" 的按鈕啊... 不過似乎是真的沒有 :( 於是我決定寫了一個很簡單的javascript去幫我完成這個煩瑣的工作。
先在Chrome按一下F12,到Console的位置,把以下javascript貼上就可以了。
先來一句簡單的句子,這是把所有"View Cards" 點一次的。
$('button.btn.mt-15.bg-primary').click();
然後再來把所有卡片都勾選。
但可能有一些卡片尚在市場中掛單賣出,所以我想先選取那些卡片。原理是查看一下表格內每張卡片的第8行 (Listed Price) 是否空白。
$('table.table.table-striped.table-hover.media-library.table-xxs').each(function(){
$(this).find('tbody tr').each(function(){
if ($(this).find('td:nth-child(8)').text() !== '') {
$(this).find('td:nth-child(1) button').click();
}
});
});
然後手動把它們取消掛單。

▲ 手動取消掛單
最後是時候選取所有卡片了。
$('table.table.table-striped.table-hover.media-library.table-xxs').each(function(){
$(this).find('tbody tr').each(function(){
if ($(this).find('td:nth-child(8)').text() === '') {
$(this).find('td:nth-child(1) button').click();
}
});
});
再手動把它們賣出。

▲ 手動賣出
大功告成了!這樣子我便節省了點擊百多次的苦差了。不過 PeakMonster能否就乾脆弄一個 "Select All" 的按鈕,我想應該很多人也需要吧?