mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-06-30 20:50:02 +02:00
Add check-tether-rate.ps1 and show-tether-rate.ps1
This commit is contained in:
@ -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))"
|
15
Scripts/show-tether-rate.ps1
Normal file
15
Scripts/show-tether-rate.ps1
Normal 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
|
Reference in New Issue
Block a user