From 5b2924877177d40194702153a6a218252d9ef66c Mon Sep 17 00:00:00 2001 From: Peter Stenger Date: Tue, 16 Jan 2018 16:34:36 -0500 Subject: [PATCH] Update README.md --- README.md | 61 ++++++------------------------------------------------- 1 file changed, 6 insertions(+), 55 deletions(-) diff --git a/README.md b/README.md index 1dc3a28..09079f1 100755 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # go-coinmarketcap # coinmarketcap --- - import "github.com/miguelmota/go-coinmarketcap" -Coin Market Cap API in golang + import "github.com/reteps/go-coinmarketcap" + +Coin Market Cap API + Scraper in golang ## Usage @@ -86,61 +86,12 @@ GlobalMarketData struct func GetMarketData() (GlobalMarketData, error) ``` -# Examples +#### func CoinMarkets ```go -package main - -import ( - "fmt" - "log" - "time" - - coinApi "github.com/miguelmota/go-coinmarketcap" -) - -func main() { - // Get global market data - marketInfo, err := coinApi.GetMarketData() - if err != nil { - log.Println(err) - } else { - fmt.Println(marketInfo) - } - - // Get info about coin - coinInfo, err := coinApi.GetCoinData("ethereum") - if err != nil { - log.Println(err) - } else { - fmt.Println(coinInfo) - - } - // Get top 10 coins - top10, err := coinApi.GetAllCoinData(10) - if err != nil { - log.Println(err) - } else { - fmt.Println(top10) - } - - var threeMonths int64 = (60 * 60 * 24 * 90) - now := time.Now() - secs := now.Unix() - start := secs - threeMonths - end := secs - - // Get graph data for coin - coinGraphData, err := coinApi.GetCoinGraphData("ethereum", start, end) - if err != nil { - log.Println(err) - } else { - fmt.Println(coinGraphData) - } - -} +func CoinMarkets(coin string) ([]Markets, error) ``` # License -MIT \ No newline at end of file +MIT