Skip to content

Instantly share code, notes, and snippets.

@json-m json-m/statics.js
Created Apr 8, 2015

Embed
What would you like to do?
eveeye.com static connection scraper
#!/bin/env node
// eveeye static connection scraper
// npm install underscore string request limiter
var _ = require('underscore')
fs = require('fs')
str = require('string')
request = require('request')
RateLimiter = require('limiter').RateLimiter
limiter = new RateLimiter(3, 'second') // lets be "reasonable"
url = "https://eveeye.com/solarsection.asp?system="
readArray = fs.readFileSync('wormholes.txt').toString().split('\n') // newline seperated list in wormholes.txt
whArray = readArray.filter(function(A){return A!==''})
function getStatic() {
var system = arguments[0]
request(url+system, function(e, r, b) {
var d = str(b).decodeHTMLEntities().s
i = str(d).stripTags().s
c = /via..(\b\w{4}\b)/g
k = i.match(c)
s = /(\b\w{4})/g // way too lazy
lol = JSON.stringify(k).match(s)
staticArray = _.toArray(lol)
_.each(staticArray, function(u, index) {
if (u=="null") { // probably not the best thing to return when related to eve
console.log(system, 'UNKNOWN') // somehow better
} else {
console.log(system, u)
}
})
})
}
_.each(whArray, function(whatever, index) {
limiter.removeTokens(1, function() {
getStatic(whatever)
})
})
@json-m

This comment has been minimized.

Copy link
Owner Author

commented May 1, 2017

eveeye.com no longer provides this service and thus this script is now defunct.

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.