Skip to content

Commit

Permalink
Merge pull request #4 from mr-pmillz/master
Browse files Browse the repository at this point in the history
Resolved deprecated TLSTimeout Object for monaco-io/request module.
  • Loading branch information
joanbono authored Aug 18, 2023
2 parents d02d1c7 + 27fe141 commit 1736d15
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 96 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,5 @@ build/*
*.syso
list.txt

testkeys.txt
testkeys.txt
gap
167 changes: 72 additions & 95 deletions checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,9 @@ func CustomSearchAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -103,10 +102,9 @@ func StaticMapAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
if resp.Code() == 200 {
Expand All @@ -127,10 +125,9 @@ func StreetViewAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()

Expand All @@ -153,10 +150,9 @@ func EmbedBasicAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
if resp.Code() == 200 {
Expand All @@ -178,10 +174,9 @@ func EmbedAdvancedAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()

Expand All @@ -204,10 +199,9 @@ func DirectionsAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -230,10 +224,9 @@ func GeocodeAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -256,10 +249,9 @@ func DistanceMatrixAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -282,10 +274,9 @@ func FindPlaceFromTextAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -308,10 +299,9 @@ func AutocompleteAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -334,10 +324,9 @@ func ElevationAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -360,10 +349,9 @@ func TimezoneAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}
resp := c.Send()
value := gjson.Get(resp.String(), "status")
Expand All @@ -386,10 +374,9 @@ func NearestRoadsAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand Down Expand Up @@ -418,11 +405,10 @@ func GeolocationAPI(api, proxy string, poc bool) {
"Authorization": "key=" + api,
"Content-Type": "application/json",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: body,
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: body,
}

resp := c.Send()
Expand All @@ -448,10 +434,9 @@ func RouteToTraveledAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -474,10 +459,9 @@ func SpeedLimitRoadsAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -501,10 +485,9 @@ func PlaceDetailsAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -528,10 +511,9 @@ func NearbySearchPlacesAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -555,10 +537,9 @@ func TextSearchPlacesAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -582,10 +563,9 @@ func PlacesPhotoAPI(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand All @@ -610,11 +590,10 @@ func PlayableLocationsAPI(api, proxy string, poc bool) {
"Authorization": "key=" + api,
"Content-Type": "application/json",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: []byte(`{"area_filter":{"s2_cell_id":7715420662885515264},"criteria":[{"gameObjectType":1,"filter":{"maxLocationCount":4,"includedTypes":["food_and_drink"]},"fields_to_return": {"paths": ["name"]}},{"gameObjectType":2,"filter":{"maxLocationCount":4},"fields_to_return": {"paths": ["types", "snapped_point"]}}]}`),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: []byte(`{"area_filter":{"s2_cell_id":7715420662885515264},"criteria":[{"gameObjectType":1,"filter":{"maxLocationCount":4,"includedTypes":["food_and_drink"]},"fields_to_return": {"paths": ["name"]}},{"gameObjectType":2,"filter":{"maxLocationCount":4},"fields_to_return": {"paths": ["types", "snapped_point"]}}]}`),
}

resp := c.Send()
Expand All @@ -640,11 +619,10 @@ func FCMAPI(api, proxy string, poc bool) {
"Authorization": "key=" + api,
"Content-Type": "application/json",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: []byte(`{"registration_ids":["ABC"]}`),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
JSON: []byte(`{"registration_ids":["ABC"]}`),
}

resp := c.Send()
Expand All @@ -668,10 +646,9 @@ func QueryAutocompletePlaces(api, proxy string, poc bool) {
Header: (map[string]string{
"User-Agent": "GAP - The Google Maps API Checker",
}),
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSTimeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
ProxyURL: proxy,
Timeout: time.Second * 20,
TLSConfig: &tls.Config{InsecureSkipVerify: true},
}

resp := c.Send()
Expand Down
18 changes: 18 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module github.com/joanbono/gap

go 1.19

require (
github.com/fatih/color v1.15.0
github.com/monaco-io/request v1.0.16
github.com/tidwall/gjson v1.15.0
)

require (
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/tidwall/match v1.1.1 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
golang.org/x/sys v0.7.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
Loading

0 comments on commit 1736d15

Please sign in to comment.