Skip to content

Instantly share code, notes, and snippets.

@json-m
Created April 8, 2015 03:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save json-m/93abd0924876f2111b4e to your computer and use it in GitHub Desktop.
Save json-m/93abd0924876f2111b4e to your computer and use it in GitHub Desktop.
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
Copy link
Author

json-m 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