-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the word “Include” before the extra consideration checkboxes
- Loading branch information
Showing
6 changed files
with
86 additions
and
86 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,59 @@ | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
type Location struct { | ||
Title string `json:"title"` | ||
ID string `json:"id"` | ||
ResultType string `json:"resultType"` | ||
Position struct { | ||
Lat float32 | ||
Lng float32 | ||
} | ||
} | ||
|
||
func Geocode(address string) (*Location, error) { | ||
if len(hereToken) == 0 { | ||
return nil, fmt.Errorf("here token not found") | ||
} | ||
|
||
req, err := http.NewRequest("GET", "https://geocode.search.hereapi.com/v1/geocode", nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
q := req.URL.Query() | ||
q.Add("q", address) | ||
q.Add("apiKey", hereToken) | ||
req.URL.RawQuery = q.Encode() | ||
|
||
resp, err := http.DefaultClient.Do(req) | ||
if err != nil { | ||
return nil, err | ||
} | ||
log.Println(resp.StatusCode) | ||
if resp.StatusCode != 200 { | ||
return nil, fmt.Errorf("non 200 return code %d", resp.StatusCode) | ||
} | ||
|
||
out, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
output := struct { | ||
Items []Location | ||
}{} | ||
err = json.Unmarshal(out, &output) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &output.Items[0], nil | ||
} | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"fmt" | ||
"io/ioutil" | ||
"log" | ||
"net/http" | ||
) | ||
|
||
type Location struct { | ||
Title string `json:"title"` | ||
ID string `json:"id"` | ||
ResultType string `json:"resultType"` | ||
Position struct { | ||
Lat float32 | ||
Lng float32 | ||
} | ||
} | ||
|
||
func Geocode(address string) (*Location, error) { | ||
if len(hereToken) == 0 { | ||
return nil, fmt.Errorf("here token not found") | ||
} | ||
|
||
req, err := http.NewRequest("GET", "https://geocode.search.hereapi.com/v1/geocode", nil) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
q := req.URL.Query() | ||
q.Add("q", address) | ||
q.Add("apiKey", hereToken) | ||
req.URL.RawQuery = q.Encode() | ||
|
||
resp, err := http.DefaultClient.Do(req) | ||
if err != nil { | ||
return nil, err | ||
} | ||
log.Println(resp.StatusCode) | ||
if resp.StatusCode != 200 { | ||
return nil, fmt.Errorf("Geocode non 200 return code %d", resp.StatusCode) | ||
} | ||
|
||
out, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
output := struct { | ||
Items []Location | ||
}{} | ||
err = json.Unmarshal(out, &output) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return &output.Items[0], nil | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
{{ template "header" . }} | ||
<title>ReUseFull</title> | ||
</head> | ||
<body> | ||
{{ template "nav" . }} | ||
<main> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col text-center"> | ||
<h5 class="mb-3">Thank you for signing up with Re.Use.Full! You will recieve an email shortly asking you to confirm your email address | ||
and a welcome email from our founder!</h5> | ||
<a href="https://app.reusefull.org/donate"> | ||
<img src="https://reusefullimages.s3.us-east-2.amazonaws.com/find-us-on.png" width=100></a> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
<footer></footer> | ||
{{ template "footerScripts" .}} | ||
</body> | ||
</html> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
{{ template "header" . }} | ||
<title>ReUseFull</title> | ||
</head> | ||
<body> | ||
{{ template "nav" . }} | ||
<main> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col text-center"> | ||
<h5 class="mb-3">Thank you for signing up with Re.Use.Full! You will receive an email shortly asking you to confirm your email address | ||
and a welcome email from our founder!</h5> | ||
<a href="https://app.reusefull.org/donate"> | ||
<img src="https://reusefullimages.s3.us-east-2.amazonaws.com/find-us-on.png" width=100></a> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
<footer></footer> | ||
{{ template "footerScripts" .}} | ||
</body> | ||
</html> |
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