diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc5410d --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# LedgerStockUpdate + +This application locates any stocks you have in your [ledger-cli](ledger-cli.org) file, then generates a price database of those stocks compatible with the application. + +### Usage + +Build the go file, and run as follows: + +```bash +./[name of executable] -f=[ledger file] -p=[price database file (to create or update)] +``` + +This should spit out a price database file, which can then be used to calculate the market value in ledger as follows: + +```bash +ledger -f [ledger file] --price-db [price database file] -V bal +``` diff --git a/main.go b/main.go index 25e8c11..20eaa20 100644 --- a/main.go +++ b/main.go @@ -34,8 +34,8 @@ func main() { } } -func GetPriceString(ticker string) (string, error) { - resp, err := http.Get("https://api.worldtradingdata.com/api/v1/stock?symbol=" + ticker + "&api_token=zkyqseprRGFE2qN0sck4QiFcmyw0kJirCeXKYcXpGM80FEBmitI03aLT31RJ") +func GetPriceString(ticker string) string { + resp, err := http.Get("https://api.worldtradingdata.com/api/v1/stock?symbol=" + ticker + "&api_token=demo") if err != nil { return "", err }