node-wargames icon indicating copy to clipboard operation
node-wargames copied to clipboard

Failed update, username lacks coordinates

Open byrongibson opened this issue 13 years ago • 2 comments

Hi Mape, really cool app. I'm playing around with it to learn node and ec2-webapp. I've got it up and running on an AWS instance, but it seems it can't get any coordinates from any of the users in #node.js on irc.freenode.net, so nothing is getting displayed on the map, just the chat log in the top right corner.

My google-fu is failing me at the moment. Is there something else I need to do to get those coordinates, or is that something that each irc user has to enable for their account? If the latter, is there a better irc server/room I should try, where users might be more likely to have coordinates enabled?

Thanks!

byrongibson avatar Jun 14 '11 03:06 byrongibson

it's an issue with http://geoip.stagas.com/?ip=1.2.3.4

any ip returns a Server Errror

and0 avatar Jul 11 '11 03:07 and0

diff --git a/lib/wargames.js b/lib/wargames.js
index e2d453b..d5146b4 100644
--- a/lib/wargames.js
+++ b/lib/wargames.js
@@ -95,7 +95,7 @@ Wargames.prototype.fetchPositions = function () {

                                console.log('Fetching position for ' + user.name + '@' + user.ip);
                                var lat,lng;
-                               request({'uri': 'http://geoip.stagas.com/?ip='+user.ip}, function(err, res, body) {
+                               request({'uri': 'http://freegeoip.net/json/'+user.ip}, function(err, res, body) {
                                        try {
                                                var geoInfo = JSON.parse(body);
                                                lat = geoInfo.latitude;

bassnode avatar Jan 24 '12 21:01 bassnode