Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
eve-marketdata.com unique planet finder
/**
* Scripts for pages alike https://eve-marketdata.com/pi.php?step=PIPlanner2&type_name=Broadcast+Node&solarsystem_name=Resbroko
*/
var dict = {
'Aqueous Liquids': ['Barren', 'Gas', 'Ice', 'Oceanic', 'Storm', 'Temperate'],
'Autotrophs': ['Temperate'],
'Base Metals': ['Ice', 'Oceanic', 'Temperate'],
'Reactive Metals': ['Ice', 'Oceanic', 'Temperate'], // FIXME
'Carbon Compounds': ['Barren', 'Oceanic', 'Temperate'],
'Complex Organisms': ['Oceanic', 'Temperate'],
'Felsic Magma': ['Lava'],
'Heavy Metals': ['Ice', 'Lava', 'Plasma'],
'Ionic Solutions': ['Gas', 'Storm'],
'Micro Organisms': ['Barren', 'Ice', 'Oceanic', 'Temperate'],
'Microorganisms': ['Barren', 'Ice', 'Oceanic', 'Temperate'], // FIXME
'Bacteria': ['Barren', 'Ice', 'Oceanic', 'Temperate'], // FIXME
'Noble Gas': ['Gas', 'Ice', 'Storm'],
'Noble Metals': ['Barren', 'Plasma'],
'Non-CS Crystals': ['Lava', 'Plasma'],
'Planktic Colonies': ['Ice', 'Oceanic'],
'Biomass': ['Ice', 'Oceanic'], // FIXME
'Reactive Gas': ['Gas'],
'Suspended Plasma': ['Lava', 'Plasma', 'Storm'],
'Plasmoids': ['Lava', 'Plasma', 'Storm'], // FIXME
}
$.getScript('https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.4/lodash.min.js')
.done(() => {
let
unique = {},
planets = [],
unique_sorted;
_.each(dict, (v, k) => {
let size = _.size(v);
dict[k] = {size: size, data: v, key: k};
})
$('.raw').each((i, item) => {
let name = item.innerText.split('\n')[1];
if (name !== undefined) {
unique[name] = dict[name];
}
});
unique_sorted = _.sortBy(unique, ['size']);
console.log(unique, unique_sorted);
logRaw = () => {
_.each(unique, function(item) {
console.log(item);
});
}
logPlanets = () => {
_.each(unique_sorted, function(item) {
if (_.isEmpty(_.intersection(planets, item['data']))) {
planets = _.concat(planets, item['data'][0]);
}
});
console.log(planets);
}
logPlanets();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.