Bladeren bron

re-added ASN and Country to Fingerprint

Tobias von Dewitz 4 jaren geleden
bovenliggende
commit
5669c7400a
3 gewijzigde bestanden met toevoegingen van 8 en 0 verwijderingen
  1. 3 0
      fingerprint.go
  2. 1 0
      go.mod
  3. 4 0
      go.sum

+ 3 - 0
fingerprint.go

@@ -5,6 +5,7 @@ import (
 
 	"git.scraperwall.com/scw/geoip"
 	"git.scraperwall.com/scw/grs"
+	"github.com/scraperwall/asndb"
 )
 
 type Fingerprint struct {
@@ -22,6 +23,8 @@ type Fingerprint struct {
 	GeoIP         *geoip.GeoIP           `bson:"geoip" json:"geoip" form:"geoip"`
 	Data          map[string]interface{} `bson:"data" json:"data" form:"data"`
 	Bot           bool                   `bson:"bot" json:"b" form:"b"`
+	ASN           *asndb.ASN             `bson:"asn" json:"asn" form:"asn"`
+	Country       string                 `bson:"country" json:"country" form:"country"`
 	//UserAgent           string        `bson:"user_agent" json:"user_agent" form:"user_agent"`
 	//Adblock             bool          `bson:"adblock" json:"adblock" form:"adblock"`
 	//AvailableResolution []int         `bson:"available_resolution" json:"available_resolution" form:"available_resolution"`

+ 1 - 0
go.mod

@@ -9,6 +9,7 @@ require (
 	github.com/google/btree v1.0.0
 	github.com/oschwald/geoip2-golang v1.3.0 // indirect
 	github.com/oschwald/maxminddb-golang v1.5.0 // indirect
+	github.com/scraperwall/asndb v1.2.0
 	golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe // indirect
 	gopkg.in/jmcvetta/napping.v3 v3.2.0 // indirect
 )

+ 4 - 0
go.sum

@@ -2,6 +2,8 @@ git.scraperwall.com/scw/geoip v1.0.2 h1:QrJr6aFyyx+5MaCJVHN/K4a60GxvkoLxiGUbPSbL
 git.scraperwall.com/scw/geoip v1.0.2/go.mod h1:vF7pVykGjjAXUNS7wkh1nP97grLRnlrtIzu2XjFI+Mg=
 git.scraperwall.com/scw/grs v0.0.0-20170601133330-3236d4163146 h1:pmtzyKPIrtqUmcRuHL6sgP0R4QdSj1xpV78L1fbBvKc=
 git.scraperwall.com/scw/grs v0.0.0-20170601133330-3236d4163146/go.mod h1:tBzymrSfvUbefC/s0jnUtcHjpcZbH7+7f755VdGGhwM=
+git.scraperwall.com/scw/ip v0.0.0-20181127150108-80dbbe18947e h1:TJIzDykAwl9XbHGRGIp2gSKmUgCzhAcQDeEjXGSCblE=
+git.scraperwall.com/scw/ip v0.0.0-20181127150108-80dbbe18947e/go.mod h1:VWpgAIAUfNlojwRfuTrv2xh4EHYHSO0jV5CKEJyktrg=
 github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
 github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
@@ -10,6 +12,8 @@ github.com/oschwald/geoip2-golang v1.3.0 h1:D+Hsdos1NARPbzZ2aInUHZL+dApIzo8E0ErJ
 github.com/oschwald/geoip2-golang v1.3.0/go.mod h1:0LTTzix/Ao1uMvOhAV4iLU0Lz7eCrP94qZWBTDKf0iE=
 github.com/oschwald/maxminddb-golang v1.5.0 h1:rmyoIV6z2/s9TCJedUuDiKht2RN12LWJ1L7iRGtWY64=
 github.com/oschwald/maxminddb-golang v1.5.0/go.mod h1:3jhIUymTJ5VREKyIhWm66LJiQt04F0UCDdodShpjWsY=
+github.com/scraperwall/asndb v1.2.0 h1:THsXpgeGb5Pdw1WMPBjwTnKRpnf5BVNxa8YKZ7V9bHQ=
+github.com/scraperwall/asndb v1.2.0/go.mod h1:FLEIYBOlrrLIu1gGSUIAGYdwV+DgEW9DQXuDvjvDMmw=
 golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe h1:6fAMxZRR6sl1Uq8U61gxU+kPTs2tR8uOySCbBP7BN/M=
 golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 gopkg.in/jmcvetta/napping.v3 v3.2.0 h1:NpSZLAL6VgiyhdqaOkxwVtHXOLrQJZ6fFOMQgp7G8PQ=