Created
August 25, 2015 06:49
-
-
Save pinscript/38ac3683467cdfbe77e2 to your computer and use it in GitHub Desktop.
Google Spreadsheet function to lookup IP for a hostname
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getIP(host) { | |
var url = "https://freegeoip.net/json/" + host; | |
var json = UrlFetchApp.fetch(url); | |
var data = JSON.parse(json); | |
return data["ip"]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment