Automatically identifies cheapest buyable stocks for easily selecting a stock to purchase.
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/487476/1328526/%5BGC%20%7C%20Library%5D%20-%20Highlight%20and%20sort%2015%20NP%20stocks.js
function highlightRows() {
var table = document.querySelector('table[border="1"]');
if (!table) {
console.log("Table not found on this page.");
return;
}
var rows = Array.from(table.querySelectorAll('tr'));
// Display buyable stocks
var curr15Rows = [];
rows.forEach(function(row) {
var cells = row.querySelectorAll('td');
if (cells.length >= 6) {
var currCell = cells[5];
if (currCell.textContent.trim() === "15") {
curr15Rows.push(row);
}
}
});
if (curr15Rows.length === 0) {
// Display a message if there are no buyable stocks
var messageDiv = document.createElement('div');
messageDiv.textContent = "😭 There are no buyable stocks at this time.";
messageDiv.style.fontSize = '24px';
messageDiv.style.textAlign = 'center';
table.parentNode.insertBefore(messageDiv, table);
} else {
curr15Rows.forEach(function(row) {
row.parentNode.removeChild(row);
table.insertBefore(row, table.firstChild);
var cells = row.querySelectorAll('td');
cells.forEach(function(cell) {
cell.style.backgroundColor = 'yellow';
});
});
}
}