Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Altify authored Mar 17, 2022
1 parent 2353d74 commit 2bb877b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@
document.cookie = "test=1;; path=/cookies/test;";
</script>
<script>
setTimeout(data, 100);
$.get('https://api.hackertarget.com/geoip/?q=116.12.250.1', function(data) {
// Convert key-value pairs to JSON
// https://stackoverflow.com/a/39284735/452587
data = data.trim().split('\n').reduce(function(obj, pair) {
data = data.trim().split('\n').reduce(function(obj, pair) {
pair = pair.split(': ');
return obj[pair[0]] = pair[1], obj;
}, {});
console.log(data);
alert(data);
});
document.cookie = 'ip='+data+';
});
</script>
Expand Down

0 comments on commit 2bb877b

Please sign in to comment.