mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
add the module to the widget_maker.go
This commit is contained in:
@@ -5,7 +5,6 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"encoding/json"
|
||||
//"github.com/wtfutil/wtf/utils"
|
||||
)
|
||||
|
||||
// Client ..
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "Stocks"
|
||||
defaultTitle = "Finnhub Stock Price"
|
||||
)
|
||||
|
||||
// Settings defines the configuration properties for this module
|
||||
|
||||
@@ -42,7 +42,7 @@ func (widget *Widget) Refresh() {
|
||||
func (widget *Widget) content() (string, string, bool) {
|
||||
quotes, err := widget.Client.Getquote()
|
||||
|
||||
title := fmt.Sprintf("%s - from finnhub api", widget.CommonSettings().Title)
|
||||
title := fmt.Sprintf("%s", widget.CommonSettings().Title)
|
||||
var str string
|
||||
wrap := false
|
||||
if err != nil {
|
||||
@@ -55,7 +55,8 @@ func (widget *Widget) content() (string, string, bool) {
|
||||
}
|
||||
|
||||
str += fmt.Sprintf(
|
||||
"[%s]: %s \n",
|
||||
"[%d]: %s %.2f\n",
|
||||
idx,
|
||||
q.Stock,
|
||||
q.C,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user