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

@ -1,10 +1,10 @@
<#
.SYNOPSIS
Checks the Dogecoin rate
Checks the Tether rate
.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
PS> ./check-doge-coin-rate
PS> ./check-tether-rate
.NOTES
Author: Markus Fleschutz · License: CC0
.LINK
@ -12,9 +12,9 @@
#>
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
} catch {
"⚠️ 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