Add check-tether-rate.ps1 and show-tether-rate.ps1

This commit is contained in:
Markus Fleschutz 2021-12-08 08:05:11 +01:00
parent ca99f13dab
commit 5d0a60bae7
3 changed files with 25 additions and 7 deletions

View File

@ -27,7 +27,7 @@ When finished say: "Computer, close [app]" to close the application.
`Computer, check` [name] `Computer, check` [name]
------------------------ ------------------------
Lets the computer check something, replace [name] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `DNS`, `Dogecoin rate`, `drives`, `dusk`, `Earth` (fun), `Ether rate`, `headlines`, `ISS`, `midnight`, `moon phase`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `time`, `time zone`, `up-time`, `VPN`, `weather`, or `zenith`. Lets the computer check something, replace [name] by: `Bitcoin rate`, `Christmas`, `CPU`, `date`, `dawn`, `DNS`, `drives`, `dusk`, `Earth` (fun), `Ether rate`, `headlines`, `ISS`, `midnight`, `moon phase`, `New Year`, `noon`, `operating system`, `ping`, `Santa`, `sunrise`, `sunset`, `swap space`, `tea time`, `Tether rate`, `time`, `time zone`, `up-time`, `VPN`, `weather`, or `zenith`.
`Computer, open` [name] `browser` `Computer, open` [name] `browser`
@ -100,7 +100,10 @@ When finished say: "Close tab" or: "Computer, close [name] browser" to close the
`Computer, show` [name] `rate` `Computer, show` [name] `rate`
------------------------------ ------------------------------
Launches the default Web browser showing the given exchange rate - replace [name] by: `Bitcoin`, `Ether`, `Euro`, or `US dollar`. Launches the default Web browser showing the given exchange rate - replace [name] by: `Bitcoin`, `Ether`, `Euro`, `Tether`, or `US dollar`.
When finished say: "Close tab" or: "Computer, close [name] browser" to close the Web browser.
🔊 Audio Voice Commands 🔊 Audio Voice Commands
------------------------ ------------------------

View File

@ -1,10 +1,10 @@
<# <#
.SYNOPSIS .SYNOPSIS
Checks the Dogecoin rate Checks the Tether rate
.DESCRIPTION .DESCRIPTION
This script queries the current Dogecoin exchange rates and answers by text-to-speech (TTS). This script queries the current Tether exchange rates and answers by text-to-speech (TTS).
.EXAMPLE .EXAMPLE
PS> ./check-doge-coin-rate PS> ./check-tether-rate
.NOTES .NOTES
Author: Markus Fleschutz · License: CC0 Author: Markus Fleschutz · License: CC0
.LINK .LINK
@ -12,9 +12,9 @@
#> #>
try { try {
$Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=DOGE&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json $Rates = (Invoke-WebRequest -uri "https://min-api.cryptocompare.com/data/price?fsym=USDT&tsyms=USD,EUR" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
& "$PSScriptRoot/give-reply.ps1" "Dogecoin is currently at $($Rates.USD) US$ and $($Rates.EUR) Euro." & "$PSScriptRoot/give-reply.ps1" "Tether is currently at $($Rates.USD) US$ and $($Rates.EUR) Euro."
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))" "⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"

View File

@ -0,0 +1,15 @@
<#
.SYNOPSIS
Shows the Tether rate
.DESCRIPTION
This script launches the Web browser and shows the Tether rate.
.EXAMPLE
PS> ./show-tether-rate
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
https://github.com/fleschutz/PowerShell
#>
& "$PSScriptRoot/open-default-browser.ps1" "https://www.bitstamp.net/markets/usdt/usd/"
exit 0 # success