add modules google api

This commit is contained in:
Alex Kup 2024-01-18 18:52:57 +03:00 committed by GitHub
parent 844816c057
commit a0a06880c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 0 deletions

16
Scripts/Find-Google.psm1 Normal file
View file

@ -0,0 +1,16 @@
function Find-Google {
param (
$Query,
$Lang = "ru",
$Num = 10,
$Start = 0,
$Key = "<TOKEN_API>",
$cx = "35c78340f49eb474a"
)
$query
$response = Invoke-RestMethod "https://www.googleapis.com/customsearch/v1?q=$Query&key=$Key&cx=$cx&lr=lang_$Lang&num=$Num&$start=$Start"
$response.items | Select-Object title,snippet,displayLink,link | Format-List
}
# Find-Google "как создать бота discord"
# Find-Google "как создать бота discord" -Lang ru -Num 10 -Start 9