Skip to content

Commit 432b8f3

Browse files
authored
Add files via upload
1 parent 16211f3 commit 432b8f3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

SniffDogLitecoin.ps1

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ while($true)
105105
$LastDonated = Get-Date
106106
}
107107
Write-Host "SniffDog dumps then checks for updates from Cryptonator..." -foregroundcolor "Yellow"
108-
$Rates = [PSCustomObject]@{}
109-
$Currency | ForEach {$Rates | Add-Member $_ (Invoke-WebRequest "https://api.cryptonator.com/api/full/ltc-btc" -UseBasicParsing | ConvertFrom-Json).ticker.price}
108+
$Rates = Invoke-RestMethod "https://api.coinbase.com/v2/exchange-rates?currency=LTC" -UseBasicParsing | Select-Object -ExpandProperty data | Select-Object -ExpandProperty rates
109+
$Currency | Where-Object {$Rates.$_} | ForEach-Object {$Rates | Add-Member $_ ([Double]$Rates.$_) -Force}
110110

111111

112112
#Load the Stats
@@ -351,17 +351,17 @@ while($true)
351351
Write-Host ""
352352
Write-Host ""
353353
Write-Host ""
354-
$Rates2 = Invoke-RestMethod "https://api.coinbase.com/v2/exchange-rates?currency=LTC" -UseBasicParsing | Select-Object -ExpandProperty data | Select-Object -ExpandProperty rates
355-
$Currency | Where-Object {$Rates2.$_} | ForEach-Object {$Rates2 | Add-Member $_ ([Double]$Rates2.$_) -Force}
356-
Write-Host "1LTC = " $Rates2.$Currency " $Currency" -foregroundcolor "Yellow"
357-
Write-Host "1LTC = " $Rates.$Currency " of a Bitcoin" -foregroundcolor "Yellow"
354+
$ltcBtcRates = Invoke-RestMethod "https://min-api.cryptocompare.com/data/pricemulti?fsyms=LTC&tsyms=BTC" -UseBasicParsing
355+
Write-Host "1LTC = " $ltcBtcRates.LTC[0].BTC " of a Bitcoin" -foregroundcolor "Yellow"
356+
Write-Host "1LTC = " $Rates.$Currency " USD" -foregroundcolor "Yellow"
357+
358358
$Miners | Where {$_.Profit -ge 1E-5 -or $_.Profit -eq $null} | Sort -Descending Type,Profit | Format-Table -GroupBy Type (
359359
@{Label = "Miner"; Expression={$_.Name}},
360360
@{Label = "Algorithm"; Expression={$_.HashRates.PSObject.Properties.Name}},
361361
@{Label = "Speed"; Expression={$_.HashRates.PSObject.Properties.Value | ForEach {if($_ -ne $null){"$($_ | ConvertTo-Hash)/s"}else{"Bench"}}}; Align='center'},
362362
@{Label = "BTC/Day"; Expression={$_.Profits.PSObject.Properties.Value | ForEach {if($_ -ne $null){ $_.ToString("N5")}else{"Bench"}}}; Align='right'},
363-
@{Label = "LTC/Day"; Expression={$_.Profits.PSObject.Properties.Value | ForEach {if($_ -ne $null){ ($_ / $Rates.$Currency).ToString("N5")}else{"Bench"}}}; Align='right'},
364-
@{Label = "$Currency/Day"; Expression={$_.Profits.PSObject.Properties.Value | ForEach {if($_ -ne $null){($_ / $Rates.$Currency * $Rates2.$Currency).ToString("N3")}else{"Bench"}}}; Align='center'},
363+
@{Label = "LTC/Day"; Expression={$_.Profits.PSObject.Properties.Value | ForEach {if($_ -ne $null){ ($_ / $ltcBtcRates.LTC[0].BTC).ToString("N5")}else{"Bench"}}}; Align='right'},
364+
@{Label = "$Currency/Day"; Expression={$_.Profits.PSObject.Properties.Value | ForEach {if($_ -ne $null){($_ / $ltcBtcRates.LTC[0].BTC * $Rates.$Currency).ToString("N3")}else{"Bench"}}}; Align='center'},
365365
@{Label = "Pool"; Expression={$_.Pools.PSObject.Properties.Value | ForEach {"$($_.Name)"}}; Align='center'},
366366
@{Label = "Coins"; Expression={$_.Pools.PSObject.Properties.Value | ForEach {" $($_.Info)"}}; Align='center'},
367367
@{Label = "Pool Fees"; Expression={$_.Pools.PSObject.Properties.Value | ForEach {"$($_.Fees)%"}}; Align='center'},
@@ -407,8 +407,8 @@ while($true)
407407
[GC]::WaitForPendingFinalizers()
408408
[GC]::Collect()
409409

410-
Write-Host "1LTC = " $Rates2.$Currency " $Currency" -foregroundcolor "Yellow"
411-
Write-Host "1LTC = " $Rates.$Currency " of a Bitcoin" -foregroundcolor "Yellow"
410+
Write-Host "1LTC = " $Rates.$Currency " $Currency" -foregroundcolor "Yellow"
411+
Write-Host "1LTC = " $ltcBtcRates.LTC[0].BTC " of a Bitcoin" -foregroundcolor "Yellow"
412412

413413
#Do nothing for a set Interval to allow miner to run
414414
If ([int]$Interval -gt [int]$CheckMinerInterval) {

0 commit comments

Comments
 (0)