Skip to content

Commit

Permalink
refreshed t
Browse files Browse the repository at this point in the history
  • Loading branch information
techthoughts2 committed Oct 12, 2021
1 parent cddd58a commit 744d47e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 25 deletions.
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ pwshPlaces is a PowerShell module that can help you discover places and search f

pwshPlaces enables you to leverage the Google Maps and/or Bing Maps API(s) to perform a variety of maps related tasks using PowerShell:

* Search for places, entities, addresses, and other points of interest
* Discover locations near your or near a specified place
* Easily perform Geocoding and reverse Geocoding actions
* Get detailed place information including opening hours, website information, and contact information
- Search for places, entities, addresses, and other points of interest
- Discover locations near your or near a specified place
- Easily perform Geocoding and reverse Geocoding actions
- Get detailed place information including opening hours, website information, and contact information

[pwshPlaces](docs/pwshPlaces.md) provides the following functions:

* [Find-BingPlace](docs/Find-BingPlace.md)
* [Find-BingTimeZone](docs/Find-BingTimeZone.md)
* [Find-GMapPlace](docs/Find-GMapPlace.md)
* [Get-GMapPlaceDetail](docs/Get-GMapPlaceDetail.md)
* [Invoke-BingGeoCode](docs/Invoke-BingGeoCode.md)
* [Invoke-GMapGeoCode](docs/Invoke-GMapGeoCode.md)
* [Search-BingNearbyPlace](docs/Search-BingNearbyPlace.md)
* [Search-GMapNearbyPlace](docs/Search-GMapNearbyPlace.md)
* [Search-GMapText](docs/Search-GMapText.md)
- [Find-BingPlace](docs/Find-BingPlace.md)
- [Find-BingTimeZone](docs/Find-BingTimeZone.md)
- [Find-GMapPlace](docs/Find-GMapPlace.md)
- [Get-GMapPlaceDetail](docs/Get-GMapPlaceDetail.md)
- [Invoke-BingGeoCode](docs/Invoke-BingGeoCode.md)
- [Invoke-GMapGeoCode](docs/Invoke-GMapGeoCode.md)
- [Search-BingNearbyPlace](docs/Search-BingNearbyPlace.md)
- [Search-GMapNearbyPlace](docs/Search-GMapNearbyPlace.md)
- [Search-GMapText](docs/Search-GMapText.md)

## Why

Expand All @@ -51,8 +51,8 @@ To use pwshPlaces you will require a Google Maps or Bing Maps API key. To use al
Both of these Map API keys are *easy to create* and have *no cost* # tiers which should meet your needs. I have provided detailed guides on how to get your API keys:

* [How to get a Google Maps API Key](docs/GoogleMapsAPI.md#how-to-get-a-google-maps-api-key)
* [How to get a Bing Maps API Key](docs/BingMapsAPI.md#how-to-get-a-bing-maps-api-key)
- [How to get a Google Maps API Key](docs/GoogleMapsAPI.md#how-to-get-a-google-maps-api-key)
- [How to get a Bing Maps API Key](docs/BingMapsAPI.md#how-to-get-a-bing-maps-api-key)

### Install pwshPlaces

Expand Down Expand Up @@ -123,6 +123,11 @@ Find-BingTimeZone -PointLatitude 29.70 -PointLongitude -98.11 -BingMapsAPIKey $b

## Notes

Read more about:

- [Google Maps API](docs/GoogleMapsAPI.md)
- [Bing Maps API](docs/BingMapsAPI.md)

This PowerShell project was created with [Catesta](https://github.com/techthoughts2/Catesta).

## Changelog
Expand Down
13 changes: 10 additions & 3 deletions docs/BingMapsAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,16 @@ Import-Module pwshPlaces
$scrapePath = $env:Temp
$locale = Invoke-BingGeoCode -Query 'New Braunfels, TX'
$areaRestaurants = Search-BingNearbyPlace -Type Restaurants -PointLatitude $locale.Latitude -PointLongitude $locale.Longitude -MaxResults 20
$locale = Invoke-BingGeoCode -Query 'New Braunfels, TX' -BingMapsAPIKey $env:BingAPIKey
$searchBingNearbyPlaceSplat = @{
Type = 'Restaurants'
PointLatitude = $locale.Latitude
PointLongitude = $locale.Longitude
MaxResults = 20
BingMapsAPIKey = $env:BingAPIKey
}
$areaRestaurants = Search-BingNearbyPlace @searchBingNearbyPlaceSplat
ConvertTo-Clixml -InputObject $areaRestaurants -Depth 100 | Out-File "$scrapePath\localRestaurants.xml"
#--------------------------------------------------------------
Expand Down
15 changes: 12 additions & 3 deletions docs/GoogleMapsAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,18 @@ Import-Module pwshPlaces
$scrapePath = $env:Temp
$locale = Invoke-GMapGeoCode -Address 'New Braunfels'
$areaRestaurants = Search-GMapNearbyPlace -Latitude $locale.Latitude -Longitude $locale.Longitude -Radius 10000 -RankByProminence -Type restaurant -AllSearchResults
$locale = Invoke-GMapGeoCode -Address 'New Braunfels' -GoogleAPIKey $env:GoogleAPIKey
$searchGMapNearbyPlaceSplat = @{
Latitude = $locale.Latitude
Longitude = $locale.Longitude
Radius = 10000
RankByProminence = $true
Type = 'restaurant'
AllSearchResults = $true
GoogleAPIKey = $env:GoogleAPIKey
}
$areaRestaurants = Search-GMapNearbyPlace @searchGMapNearbyPlaceSplat
ConvertTo-Clixml -InputObject $areaRestaurants -Depth 100 | Out-File "$scrapePath\localRestaurants.xml"
#--------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/Tests/Infrastructure/pwshPlaces-Infra.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ Import-Module $PathToManifest -Force
#-------------------------------------------------------------------------
Describe 'Infrastructure Tests' -Tag Infrastructure {
# for local dev testing only
BeforeEach {
$env:GoogleAPIKey = 'AIzaSyCyXypZobAjrOnRKoPKa6aZqcRWPw7od-U'
$env:BingAPIKey = 'AlX3WrsMGXpT3HauFYqm7AqAU3s1xWWb_Fp55Xpf99m0gHWxHouzZssxngC9NUI9'
}
# BeforeEach {
# $env:GoogleAPIKey = ''
# $env:BingAPIKey = ''
# }
Context 'Google Maps Function Tests' {

Context 'Find-GMapPlace' {
Expand Down

0 comments on commit 744d47e

Please # to comment.