Squashed commit of the following:

commit e7f1c4c84579b959fe2997ff4d2315ee53acfe9a
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Thu Sep 29 11:22:44 2016 +0100

    Add latest change, fix spelling errors in rest of changelog

commit 637b5107b557f1c2a56327a40b3d7b4b7297fa29
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 21:13:06 2016 +0100

    Add a test for uncertainty parameter

commit 5e7504b323debf9c91e0cca428b4dca7dda0789d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 21:11:12 2016 +0100

    Format the ternaty operator correctly

commit 19c978a5ac59cd7dfdceee9a8f1aaa6539d8ac66
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 20:46:19 2016 +0100

    Fix typo

commit d4e5b5fc384d0ccd715ea28a51821f958f6c2caa
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 20:41:23 2016 +0100

    Add paraphanalia

commit a96f104894de6c06dc5e41044482de2355cb4965
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 20:35:17 2016 +0100

    Add the geolocation uncertainty to nearby places request

commit 0f6d5649e2f3316040d7453f5fcc96ac1f0ac783
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 20:34:38 2016 +0100

    Use a query parameter for geolocation uncertainty

commit a9147a074315fabb0d76e5991b34a70b2143761c
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 19:58:08 2016 +0100

    Make use of uncertainty parameter when finding nearby places

commit bad384b5d8be3ea8905d8f6ca3c20f448869853d
Author: Jonny Barnes <jonny@jonnybarnes.uk>
Date:   Wed Sep 28 19:28:42 2016 +0100

    Support sending uncertainty value to micropub endpoint
This commit is contained in:
Jonny Barnes 2016-09-29 11:28:31 +01:00
parent 4e69a4d55c
commit 2c6b9df97a
9 changed files with 39 additions and 24 deletions

View file

@ -307,9 +307,13 @@ class MicropubClientController extends Controller
}
try {
$query = 'geo:' . $latitude . ',' . $longitude;
if ($request->input('uncertainty') !== null) {
$query .= ';u=' . $request->input('uncertainty');
}
$response = $this->guzzleClient->get($micropubEndpoint, [
'headers' => ['Authorization' => 'Bearer ' . $token],
'query' => ['q' => 'geo:' . $latitude . ',' . $longitude],
'query' => ['q' => $query],
]);
} catch (\GuzzleHttp\Exception\BadResponseException $e) {
return response()->json([