Created
April 16, 2020 17:08
-
-
Save diegoparrilla/c64dfdd7245a9f5740c753915e437ccb to your computer and use it in GitHub Desktop.
Google Spreadsheet custom function to get the full ip report from Auth0 Signals/Apility
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 SIGNALSFULLIP(input) { | |
var response = UrlFetchApp.fetch("https://signals.api.auth0.com/ip/" + input + "?token=YOUR_API_TOKEN"); | |
// Parse the JSON reply | |
var json = response.getContentText(); | |
var data = JSON.parse(json); | |
var score = data['fullip']['score']; | |
var blacklists = data['fullip']['badip']['blacklists'].join(','); | |
var as = data['fullip']['geo']['as']['name']; | |
var asnum = data['fullip']['geo']['as']['asn']; | |
var country = data['fullip']['geo']['country']; | |
var history_score = data['fullip']['history']['score']; | |
array = []; | |
array.push(score); | |
array.push(blacklists); | |
array.push(country); | |
array.push('AS' + asnum + ' - ' + as); | |
array.push(history_score); | |
Logger.log(score); | |
Logger.log(blacklists); | |
Logger.log(country); | |
Logger.log('AS' + asnum + ' - ' + as); | |
Logger.log(history_score); | |
return [array]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment