diff --git a/html/index.html b/html/index.html index 8041592..6cf5111 100644 --- a/html/index.html +++ b/html/index.html @@ -136,6 +136,11 @@ Timezone {{ .Timezone }} + {{ end }} {{ if .IsDayLightSavings }} + + Is Daylight Savings? + {{ .IsDayLightSavings }} + {{ end }} {{ if .ASN }} ASN @@ -166,7 +171,52 @@ User agent: Raw {{ .UserAgent.RawValue }} - {{ end }} {{ end }} + {{ end }} + + {{ if .IsProxy }} + + Is Proxy? + {{ .IsProxy }} + + {{ end }} + + {{ if .IsCrawler }} + + Is Crawler? + {{ .IsCrawler }} + + + Crawler Name + {{ .CrawlerName }} + + + Crawler Type + {{ .CrawlerType }} + + {{ end }} + + {{ if .IsTor }} + + Is Tor? + {{ .IsTor }} + + {{ end }} + + {{ if .ThreatLevel }} + + Threat Level + {{ .ThreatLevel }} + + {{ end }} + + {{ if .ThreatTypes }} + + Threat Types + {{ .ThreatTypes }} + + {{ end }} + + {{ end }} {{ if .Country }} {{ if .UsingGeoIP }}

diff --git a/iputil/ipstack/ipstack.go b/iputil/ipstack/ipstack.go index ce8383e..44f80c7 100644 --- a/iputil/ipstack/ipstack.go +++ b/iputil/ipstack/ipstack.go @@ -41,6 +41,17 @@ func (ips *IPStack) Parse(ip net.IP, hostname string) (parser.Response, error) { if res.Timezone != nil { parserResponse.Timezone = res.Timezone.ID + parserResponse.IsDayLightSavings = res.Timezone.IsDaylightSaving + } + + if res.Security != nil { + parserResponse.IsProxy = res.Security.IsProxy + parserResponse.IsCrawler = res.Security.IsCrawler + parserResponse.CrawlerName = res.Security.CrawlerName + parserResponse.CrawlerType = res.Security.CrawlerType + parserResponse.IsTor = res.Security.IsTOR + parserResponse.ThreatLevel = res.Security.ThreatLevel + parserResponse.ThreatTypes = &res.Security.ThreatTypes } if res.Location != nil { diff --git a/iputil/paser/parser.go b/iputil/paser/parser.go index 4cf731a..92ca9ee 100644 --- a/iputil/paser/parser.go +++ b/iputil/paser/parser.go @@ -13,23 +13,32 @@ type Parser interface { } type Response struct { - UsingGeoIP bool `json:"UsingGeoIP"` - UsingIPStack bool `json:"UsingIPStack"` - IP net.IP `json:"ip"` - IPDecimal *big.Int `json:"ip_decimal"` - Country string `json:"country,omitempty"` - CountryISO string `json:"country_iso,omitempty"` - CountryEU *bool `json:"country_eu,omitempty"` - RegionName string `json:"region_name,omitempty"` - RegionCode string `json:"region_code,omitempty"` - MetroCode uint `json:"metro_code,omitempty"` - PostalCode string `json:"zip_code,omitempty"` - City string `json:"city,omitempty"` - Latitude float64 `json:"latitude,omitempty"` - Longitude float64 `json:"longitude,omitempty"` - Timezone string `json:"time_zone,omitempty"` - ASN string `json:"asn,omitempty"` - ASNOrg string `json:"asn_org,omitempty"` - Hostname string `json:"hostname,omitempty"` - UserAgent *useragent.UserAgent `json:"user_agent,omitempty"` + UsingGeoIP bool `json:"UsingGeoIP"` + UsingIPStack bool `json:"UsingIPStack"` + IP net.IP `json:"ip"` + IPDecimal *big.Int `json:"ip_decimal"` + Country string `json:"country,omitempty"` + CountryISO string `json:"country_iso,omitempty"` + CountryEU *bool `json:"country_eu,omitempty"` + RegionName string `json:"region_name,omitempty"` + RegionCode string `json:"region_code,omitempty"` + MetroCode uint `json:"metro_code,omitempty"` + PostalCode string `json:"zip_code,omitempty"` + City string `json:"city,omitempty"` + Latitude float64 `json:"latitude,omitempty"` + Longitude float64 `json:"longitude,omitempty"` + Timezone string `json:"time_zone,omitempty"` + IsDayLightSavings bool `json:"is_daylight_savings,omitempty"` + ASN string `json:"asn,omitempty"` + ASNOrg string `json:"asn_org,omitempty"` + Hostname string `json:"hostname,omitempty"` + UserAgent *useragent.UserAgent `json:"user_agent,omitempty"` + CurrencyCode string `json:"currency_code,omitempty"` + IsProxy bool `json:"is_proxy,omitempty"` + IsCrawler bool `json:"is_crawler,omitempty"` + CrawlerName string `json:"crawler_name,omitempty"` + CrawlerType string `json:"crawler_type,omitempty"` + IsTor bool `json:"is_tor,omitempty"` + ThreatLevel string `json:"threat_level,omitempty"` + ThreatTypes *interface{} `json:"threat_types,omitempty"` }