1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Merge branch 'master' into bittrex

This commit is contained in:
jeangovil
2018-06-04 21:00:28 +04:30
committed by GitHub
57 changed files with 483 additions and 36 deletions

View File

@@ -3,9 +3,8 @@ package cryptolive
import (
"encoding/json"
"fmt"
"time"
"net/http"
"time"
"github.com/olebedev/config"
"github.com/senorprogrammer/wtf/wtf"
@@ -32,7 +31,7 @@ type Widget struct {
func NewWidget() *Widget {
started = false
widget := Widget{
TextWidget: wtf.NewTextWidget(" $ CryptoLive ", "cryptolive", false),
TextWidget: wtf.NewTextWidget(" CryptoLive ", "cryptolive", false),
updateInterval: Config.UInt("wtf.mods.cryptolive.updateInterval", 10),
}
@@ -98,7 +97,7 @@ func display(widget *Widget) {
toPriceColor = Config.UString("wtf.mods.cryptolive.colors.to.price", "green")
)
for _, item := range widget.list.items {
str += fmt.Sprintf("[%s]%s[%s](%s):\n", fromNameColor, item.displayName, fromDisplayNameColor, item.name)
str += fmt.Sprintf(" [%s]%s[%s] (%s)\n", fromNameColor, item.displayName, fromDisplayNameColor, item.name)
for _, toItem := range item.to {
str += fmt.Sprintf("\t[%s]%s: [%s]%f\n", toNameColor, toItem.name, toPriceColor, toItem.price)
}
@@ -116,7 +115,7 @@ func getToList(fromName string) []*toCurrency {
for _, to := range toNames {
toList = append(toList, &toCurrency{
name: to.(string),
price: -1,
price: 0,
})
}