Skip to content
Sign up
Sign in
This repository
Explore
Features
Enterprise
Blog
Star
3
Fork
0
frida
/
geoshark
Code
Issues
Pull Requests
Pulse
Graphs
HTTPS
clone URL
Subversion
checkout URL
You can clone with
HTTPS
or
Subversion
.
Download ZIP
Permalink
Browse code
Resolve IP addresses to geo coordinates
Loading branch information
...
commit
a1aaa7eb3b4358c419ceff1a2936a4e096b85f36
1 parent
5cfed2c
oleavr
authored
Jun 22, 2014
Unified
Split
Showing
1 changed file
with
16 additions
and
0 deletions
.
+
16
−
0
geoshark.qml
16
geoshark.qml
Show notes
View
@@ -79,6 +79,22 @@ ApplicationWindow {
}
onMessage: {
messages.append(JSON.stringify(object) + "\n");
+ if (object.type === "send") {
+ var stanza = object.payload;
+ if (stanza.name === "new-ip-address") {
+ var ip = stanza.payload;
+ var xhr = new XMLHttpRequest();
+ xhr.onreadystatechange = function () {
+ if (xhr.readyState === XMLHttpRequest.DONE) {
+ var location = JSON.parse(xhr.responseText);
+ messages.append("Resolved " + ip +
+ " to " + JSON.stringify(location) + "\n");
+ }
+ };
+ xhr.open("GET", "http://freegeoip.net/json/" + ip);
+ xhr.send();
+ }
+ }
}
}
}
Toggle all file notes
Please
sign in
to comment.
Something went wrong with that request. Please try again.