Skip to content

Instantly share code, notes, and snippets.

@Krailon
Last active January 5, 2018 15:53
Show Gist options
  • Save Krailon/bfe5a2d312c2854aa1c5ffbf185b79fe to your computer and use it in GitHub Desktop.
Save Krailon/bfe5a2d312c2854aa1c5ffbf185b79fe to your computer and use it in GitHub Desktop.
Javascript functions for assisting in informed Gridcoin BOINC project selection
function highlight_gpu_projects(gpu_projects) {
if (location.hostname != 'gridcoinstats.eu' || location.pathname != '/project') {
throw 'This function is designed to run only on https://gridcoinstats.eu/project'
}
for (var index in gpu_projects) {
$('td a[href*="gridcoinstats.eu/project/"]').filter(function() {
return $(this).text().toLowerCase() == gpu_projects[index].toLowerCase()
}).parent().parent().css('background-color', 'rgb(96, 255, 80)')
//$('a:contains(' + gpu_projects[index] + ')').parent().parent().css('background-color', 'rgb(96, 255, 80)')
}
}
// This function runs on the official Gridcoin project whitelist page @ https://www.gridcoin.us/Guides/whitelist.htm
function get_gpu_projects() {
if (location.hostname != 'www.gridcoin.us' || location.pathname != '/Guides/whitelist.htm') {
throw 'This function is designed to run only on https://www.gridcoin.us/Guides/whitelist.htm'
}
var gpu_projects = []
$('td:nth-child(5) i.fa-check').parent().parent().children(':first-child').children().each(function(){
gpu_projects.push($(this).text())
})
return gpu_projects
}
// This function runs on the official Gridcoin project whitelist page @ https://www.gridcoin.us/Guides/whitelist.htm
function get_cpu_projects() {
if (location.hostname != 'www.gridcoin.us' || location.pathname != '/Guides/whitelist.htm') {
throw 'This function is designed to run only on https://www.gridcoin.us/Guides/whitelist.htm'
}
var cpu_projects = []
$('td:nth-child(4) i.fa-check').parent().parent().children(':first-child').children().each(function(){
cpu_projects.push($(this).text())
})
return cpu_projects
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment