mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-23 07:26:47 +00:00
cmd/apichecker: Remove tool (#1921)
* chore: Remove apichecker.tmpl Removed template file related to the decommissioned apichecker. * chore: Remove apichecker.tmpl Removed template file related to the decommissioned apichecker. --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
@@ -1,132 +0,0 @@
|
||||
# GoCryptoTrader package Apichecker
|
||||
|
||||
<img src="/common/gctlogo.png?raw=true" width="350px" height="350px" hspace="70">
|
||||
|
||||
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/actions/workflows/tests.yml)
|
||||
[](https://github.com/thrasher-corp/gocryptotrader/blob/master/LICENSE)
|
||||
[](https://godoc.org/github.com/thrasher-corp/gocryptotrader/cmd/apichecker)
|
||||
[](https://codecov.io/gh/thrasher-corp/gocryptotrader)
|
||||
[](https://goreportcard.com/report/github.com/thrasher-corp/gocryptotrader)
|
||||
|
||||
|
||||
This apichecker package is part of the GoCryptoTrader codebase.
|
||||
|
||||
## This is still in active development
|
||||
|
||||
You can track ideas, planned features and what's in progress on our [GoCryptoTrader Kanban board](https://github.com/orgs/thrasher-corp/projects/3).
|
||||
|
||||
Join our slack to discuss all things related to GoCryptoTrader! [GoCryptoTrader Slack](https://join.slack.com/t/gocryptotrader/shared_invite/enQtNTQ5NDAxMjA2Mjc5LTc5ZDE1ZTNiOGM3ZGMyMmY1NTAxYWZhODE0MWM5N2JlZDk1NDU0YTViYzk4NTk3OTRiMDQzNGQ1YTc4YmRlMTk)
|
||||
|
||||
## Current Features for apichecker
|
||||
|
||||
+ Checks for API updates
|
||||
+ Can automatically update Trello checklist for the updates required
|
||||
+ Supports trello integration
|
||||
|
||||
#### This tool tracks changes in exchange API documentation
|
||||
#### Keeps track of all the updates using the GoCryptoTrader trello board
|
||||
|
||||
Be aware, this tool will:
|
||||
- Automatically update the live trello board if API keys and trello information are provided.
|
||||
- Automatically update the main json updates file, however a backup of the copy before the updates will be stored.
|
||||
|
||||
## Usage
|
||||
|
||||
+ To run a real check for updates, parse Trello API info as flags or add them to the updates.json file and use the following command from apichecker folder in GCT:
|
||||
|
||||
###### Linux/OSX
|
||||
GoCryptoTrader is built using [Go Modules](https://github.com/golang/go/wiki/Modules) and requires Go 1.11 or above
|
||||
Using Go Modules you now clone this repository **outside** your GOPATH
|
||||
|
||||
```bash
|
||||
git clone https://github.com/thrasher-corp/gocryptotrader.git
|
||||
cd gocryptotrader/cmd/apichecker
|
||||
go build
|
||||
./apichecker
|
||||
```
|
||||
|
||||
###### Windows
|
||||
|
||||
```bash
|
||||
git clone https://github.com/thrasher-corp/gocryptotrader.git
|
||||
cd gocryptotrader\cmd\apichecker
|
||||
go build && apichecker.exe
|
||||
```
|
||||
|
||||
+ Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done:
|
||||
|
||||
###### HTML Scraping method:
|
||||
HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependent on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent.
|
||||
```go
|
||||
func TestAdd(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "revision-history",
|
||||
TokenDataEnd: "table",
|
||||
TextTokenData: "td",
|
||||
DateFormat: "2006/01/02",
|
||||
RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
CheckString: "2019/11/15",
|
||||
Path: "https://docs.gemini.com/rest-api/#revision-history"}
|
||||
err := Add("Gemini", htmlScrape, data.Path, data, true, &testConfigData)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
###### Github SHA Check Method:
|
||||
```go
|
||||
func TestAdd(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := GithubData{Repo: "LBank-exchange/lbank-official-api-docs"}
|
||||
err := Add("Lbank", github, fmt.Sprintf(githubPath, data.Repo), data, false, &configData)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
###### Add using flags:
|
||||
```bash
|
||||
apichecker.exe -add=true -key=id -val=revision-history -tokendata=h1 -tokendataend=table -texttokendata=td -dateformat=2006/01/02 -checktype="HTML String Check" -regexp="^20(\d){2}/(\d){2}/(\d){2}$" -path="https://docs.gemini.com/rest-api/#revision-history" -exchangename=Gemini
|
||||
```
|
||||
|
||||
+ If all the authentication variables for trello are set trello checklist will be automatically updated with the format of 'Exchange Name (integer of how many updates have been released since the exchange API was last worked on):
|
||||
|
||||
- To acquire your trello key and access token please login into trello using the following link and follow the steps: https://trello.com/app-key
|
||||
|
||||
- To acquire BoardID, ListID, CardID and ChecklistID inbuilt functions can be used such as trelloGetAllLists()
|
||||
|
||||
- To create a new list, card, checklist, and to populate the the checklist --create flag can be used.
|
||||
|
||||
- To create a new check within a checklist, an inbuilt function within apichecker can be used: trelloCreateNewCheck
|
||||
|
||||
- For the first time running the application & to create a list, card and checklist use the following:
|
||||
```bash
|
||||
apichecker.exe --create -apikey="insertkeyhere" -apitoken="inserttokenhere" -boardname="insertboardnamehere"
|
||||
```
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
|
||||
## Contribution
|
||||
|
||||
Please feel free to submit any pull requests or suggest any desired features to be added.
|
||||
|
||||
When submitting a PR, please abide by our coding guidelines:
|
||||
|
||||
+ Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting) guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).
|
||||
+ Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary) guidelines.
|
||||
+ Code must adhere to our [coding style](https://github.com/thrasher-corp/gocryptotrader/blob/master/doc/coding_style.md).
|
||||
+ Pull requests need to be based on and opened against the `master` branch.
|
||||
|
||||
## Donations
|
||||
|
||||
<img src="https://github.com/thrasher-corp/gocryptotrader/blob/master/web/src/assets/donate.png?raw=true" hspace="70">
|
||||
|
||||
If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
|
||||
|
||||
***bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc***
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,656 +0,0 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
gctfile "github.com/thrasher-corp/gocryptotrader/common/file"
|
||||
"github.com/thrasher-corp/gocryptotrader/encoding/json"
|
||||
exchange "github.com/thrasher-corp/gocryptotrader/exchanges"
|
||||
"github.com/thrasher-corp/gocryptotrader/log"
|
||||
)
|
||||
|
||||
var (
|
||||
testAPIKey = ""
|
||||
testAPIToken = ""
|
||||
testChecklistID = ""
|
||||
testCardID = ""
|
||||
testListID = ""
|
||||
testBoardID = ""
|
||||
testBoardName = ""
|
||||
canTestMainFile = false
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
setTestVars()
|
||||
err := log.SetGlobalLogConfig(log.GenDefaultSettings())
|
||||
if err != nil {
|
||||
log.Errorln(log.Global, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
log.Infoln(log.Global, "set verbose to true for more detailed output")
|
||||
configData, err = readFileData(jsonFile)
|
||||
if err != nil {
|
||||
log.Errorln(log.Global, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
testConfigData, err = readFileData(testJSONFile)
|
||||
if err != nil {
|
||||
log.Errorln(log.Global, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
usageData = testConfigData
|
||||
setTestVars()
|
||||
testExitCode := m.Run()
|
||||
err = removeTestFileVars()
|
||||
if err != nil {
|
||||
log.Errorln(log.Global, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(testExitCode)
|
||||
}
|
||||
|
||||
func areTestAPIKeysSet() bool {
|
||||
return (testAPIKey != "" && testAPIToken != "")
|
||||
}
|
||||
|
||||
func setTestVars() {
|
||||
if !canUpdateTrello() {
|
||||
apiKey = testAPIKey
|
||||
apiToken = testAPIToken
|
||||
trelloChecklistID = testChecklistID
|
||||
trelloCardID = testCardID
|
||||
trelloListID = testListID
|
||||
trelloBoardID = testBoardID
|
||||
trelloBoardName = testBoardName
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func removeTestFileVars() error {
|
||||
a, err := readFileData(testJSONFile)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a.BoardID = ""
|
||||
a.CardID = ""
|
||||
a.ChecklistID = ""
|
||||
a.Key = ""
|
||||
a.ListID = ""
|
||||
a.Token = ""
|
||||
file, err := json.MarshalIndent(&a, "", " ")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return os.WriteFile(testJSONFile, file, gctfile.DefaultPermissionOctal)
|
||||
}
|
||||
|
||||
func canTestTrello() bool {
|
||||
if testAPIKey != "" && testAPIToken != "" && testChecklistID != "" && testCardID != "" && testListID != "" && (testBoardID != "" || testBoardName != "") {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func TestCheckUpdates(t *testing.T) {
|
||||
if !canUpdateTrello() || !canTestTrello() {
|
||||
t.Skip("cannot update or test trello, skipping")
|
||||
}
|
||||
err := checkUpdates(testJSONFile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateFile(t *testing.T) {
|
||||
realConf, err := readFileData(jsonFile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
configData = realConf
|
||||
err = updateFile(testJSONFile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
testConf, err := readFileData(testJSONFile)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !reflect.DeepEqual(realConf, testConf) {
|
||||
t.Error("test file update failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckExistingExchanges(t *testing.T) {
|
||||
t.Parallel()
|
||||
if !checkExistingExchanges("Kraken") {
|
||||
t.Fatal("Kraken data not found")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckChangeLog(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "revision-history",
|
||||
TokenDataEnd: "table",
|
||||
TextTokenData: "td",
|
||||
DateFormat: "2006/01/02",
|
||||
RegExp: `^20(\d){2}/(\d){2}/(\d){2}$`,
|
||||
Path: "https://docs.gemini.com/rest-api/#revision-history",
|
||||
}
|
||||
if _, err := checkChangeLog(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestAdd(t *testing.T) {
|
||||
t.Parallel()
|
||||
data2 := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "change-log",
|
||||
TextTokenData: "strong",
|
||||
TokenDataEnd: "p",
|
||||
Path: "incorrectpath",
|
||||
}
|
||||
err := addExch("FalseName", htmlScrape, data2, false)
|
||||
if err == nil {
|
||||
t.Error("expected an error due to invalid path being parsed in")
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeGemini(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "revision-history",
|
||||
TokenDataEnd: "table",
|
||||
TextTokenData: "td",
|
||||
DateFormat: "2006/01/02",
|
||||
RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
CheckString: "2019/11/15",
|
||||
Path: "https://docs.gemini.com/rest-api/#revision-history",
|
||||
}
|
||||
_, err := htmlScrapeDefault(&data)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeHuobi(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "change-log",
|
||||
TokenDataEnd: "h2",
|
||||
TextTokenData: "td",
|
||||
DateFormat: "2006.01.02 15:04",
|
||||
RegExp: "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
|
||||
CheckString: "2019.12.27 19:00",
|
||||
Path: "https://huobiapi.github.io/docs/spot/v1/en/#change-log",
|
||||
}
|
||||
_, err := htmlScrapeDefault(&data)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeCoinbasepro(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "changelog",
|
||||
TokenDataEnd: "ul",
|
||||
TextTokenData: "strong",
|
||||
DateFormat: "01/02/06",
|
||||
RegExp: "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
|
||||
CheckString: "12/16/19",
|
||||
Path: "https://docs.pro.coinbase.com/#changelog",
|
||||
}
|
||||
_, err := htmlScrapeDefault(&data)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBitfinex(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{DateFormat: "2006-01-02", RegExp: `section-v-(2\d{3}-\d{1,2}-\d{1,2})`, Path: "https://docs.bitfinex.com/docs/changelog"}
|
||||
r, err := htmlScrapeBitfinex(&data)
|
||||
require.NoError(t, err, "htmlScrapeBitfinex must not error")
|
||||
require.NotEmpty(t, r, "htmlScrapeBitfinex must return a non empty result")
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBitmex(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h4",
|
||||
Key: "id",
|
||||
Val: "",
|
||||
TokenDataEnd: "",
|
||||
TextTokenData: "",
|
||||
DateFormat: "Jan-2-2006",
|
||||
RegExp: `([A-Z]{1}[a-z]{2}-\d{1,2}-2\d{3})`,
|
||||
Path: "https://www.bitmex.com/static/md/en-US/apiChangelog",
|
||||
}
|
||||
if _, err := htmlScrapeBitmex(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeHitBTC(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{RegExp: `newest version \d{1}.\d{1}`, Path: "https://api.hitbtc.com/"}
|
||||
r, err := htmlScrapeHitBTC(&data)
|
||||
require.NoError(t, err, "htmlScrapeHitBTC must not error")
|
||||
require.NotEmpty(t, r, "htmlScrapeHitBTC must return a non empty result")
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBTSE(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
RegExp: `^version: \d{1}.\d{1}.\d{1}`,
|
||||
Path: "https://api.btcmarkets.net/openapi/info/index.yaml",
|
||||
}
|
||||
if _, err := htmlScrapeBTSE(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBTCMarkets(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
RegExp: `^version: \d{1}.\d{1}.\d{1}`,
|
||||
Path: "https://api.btcmarkets.net/openapi/info/index.yaml",
|
||||
}
|
||||
if _, err := htmlScrapeBTCMarkets(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBitflyer(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "p",
|
||||
TokenDataEnd: "h3",
|
||||
TextTokenData: "code",
|
||||
RegExp: `^https://api.bitflyer.com/v\d{1}/$`,
|
||||
Path: "https://lightning.bitflyer.com/docs?lang=en",
|
||||
}
|
||||
if _, err := htmlScrapeBitflyer(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLPoloniex(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "changelog",
|
||||
TokenDataEnd: "div",
|
||||
TextTokenData: "h2",
|
||||
DateFormat: "2006-01-02",
|
||||
RegExp: `(2\d{3}-\d{1,2}-\d{1,2})`,
|
||||
Path: "https://docs.poloniex.com/#changelog",
|
||||
}
|
||||
if _, err := htmlScrapePoloniex(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeExmo(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
RegExp: `Last updated on [\s\S]*, 20\d{2}`,
|
||||
Path: "https://exmo.com/en/api/",
|
||||
}
|
||||
if _, err := htmlScrapeExmo(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLBitstamp(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
RegExp: `refer to the v\d{1} API for future references.`,
|
||||
Path: "https://www.bitstamp.net/api/",
|
||||
}
|
||||
if _, err := htmlScrapeBitstamp(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLKraken(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h3",
|
||||
TokenDataEnd: "p",
|
||||
TextTokenData: "p",
|
||||
RegExp: `URL: https://api.kraken.com/\d{1}/private/Balance`,
|
||||
Path: "https://www.kraken.com/features/api",
|
||||
}
|
||||
if _, err := htmlScrapeKraken(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLAlphaPoint(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "introduction",
|
||||
TokenDataEnd: "blockquote",
|
||||
TextTokenData: "h3",
|
||||
RegExp: `revised-calls-\d{1}-\d{1}-\d{1}-gt-\d{1}-\d{1}-\d{1}`,
|
||||
Path: "https://alphapoint.github.io/slate/#introduction",
|
||||
}
|
||||
if _, err := htmlScrapeAlphaPoint(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLYobit(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h2",
|
||||
Key: "id",
|
||||
Path: "https://www.yobit.net/en/api/",
|
||||
}
|
||||
if _, err := htmlScrapeYobit(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeOk(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "a",
|
||||
Key: "href",
|
||||
Val: "./#change-change",
|
||||
TokenDataEnd: "./#change-",
|
||||
RegExp: `./#change-\d{8}`,
|
||||
Path: "https://www.okx.com/docs/en/",
|
||||
}
|
||||
if _, err := htmlScrapeOk(&data); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdate(t *testing.T) {
|
||||
t.Parallel()
|
||||
var exchCheck, updatedExch HTMLScrapingData
|
||||
for x := range configData.Exchanges {
|
||||
if configData.Exchanges[x].Name == "Exmo" {
|
||||
exchCheck = *configData.Exchanges[x].Data.HTMLData
|
||||
}
|
||||
}
|
||||
info := ExchangeInfo{
|
||||
Name: "Exmo",
|
||||
CheckType: "HTML String Check",
|
||||
Data: &CheckData{
|
||||
HTMLData: &HTMLScrapingData{
|
||||
RegExp: `Last updated on [\s\S]*, 20\d{2}`,
|
||||
Path: "https://exmo.com/en/api/",
|
||||
},
|
||||
},
|
||||
}
|
||||
updatedExchs := update("Exmo", configData.Exchanges, info)
|
||||
for y := range updatedExchs {
|
||||
if updatedExchs[y].Name == "Exmo" {
|
||||
updatedExch = *updatedExchs[y].Data.HTMLData
|
||||
}
|
||||
}
|
||||
if updatedExch == exchCheck {
|
||||
t.Fatal("update failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckMissingExchanges(t *testing.T) {
|
||||
t.Parallel()
|
||||
if a := checkMissingExchanges(); len(a) > len(exchange.Exchanges) {
|
||||
t.Fatal("invalid response")
|
||||
}
|
||||
}
|
||||
|
||||
func TestNameUpdates(t *testing.T) {
|
||||
t.Parallel()
|
||||
tester := []struct {
|
||||
Name string
|
||||
Status string
|
||||
ExpectedName string
|
||||
ErrorExpected bool
|
||||
}{
|
||||
{
|
||||
Name: "incorrectname",
|
||||
Status: "incomplete",
|
||||
ErrorExpected: true,
|
||||
},
|
||||
{
|
||||
Name: "Gemini 2 2",
|
||||
Status: "incomplete",
|
||||
ErrorExpected: false,
|
||||
},
|
||||
{
|
||||
Name: " Gemini 23",
|
||||
Status: "incomplete",
|
||||
ErrorExpected: true,
|
||||
},
|
||||
{
|
||||
Name: "Gemini 123",
|
||||
Status: "complete",
|
||||
ExpectedName: "Gemini 1",
|
||||
ErrorExpected: false,
|
||||
},
|
||||
{
|
||||
Name: "Gemini",
|
||||
Status: "complete",
|
||||
ExpectedName: "Gemini 1",
|
||||
ErrorExpected: false,
|
||||
},
|
||||
{
|
||||
Name: "Gemini 24 ",
|
||||
Status: "incomplete",
|
||||
ErrorExpected: false,
|
||||
},
|
||||
}
|
||||
for x := range tester {
|
||||
r, err := nameStateChanges(tester[x].Name, tester[x].Status)
|
||||
if r != tester[x].ExpectedName && err != nil && !tester[x].ErrorExpected {
|
||||
t.Errorf("%d failed, expected %v, %v, got: %v, %v\n", x,
|
||||
tester[x].ExpectedName,
|
||||
tester[x].ErrorExpected,
|
||||
r,
|
||||
err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadFileData(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := readFileData(testJSONFile)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetSha(t *testing.T) {
|
||||
t.Parallel()
|
||||
_, err := getSha("binance-exchange/binance-official-api-docs")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCheckBoardID(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
a, err := trelloCheckBoardID()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if a != true {
|
||||
t.Error("no match found for the given boardID")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrelloGetLists(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if _, err := trelloGetLists(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAllCards(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if _, err := trelloGetAllCards(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetAllChecklists(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if _, err := trelloGetAllChecklists(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrelloGetAllBoards(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if trelloBoardID != "" || testBoardName != "" {
|
||||
t.Skip("trello details empty, skipping")
|
||||
}
|
||||
if _, err := trelloGetBoardID(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateNewList(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if err := trelloCreateNewList(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrelloCreateNewCard(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if err := trelloCreateNewCard(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateNewChecklist(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
if err := trelloCreateNewChecklist(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestWriteAuthVars(t *testing.T) {
|
||||
if canTestMainFile {
|
||||
trelloCardID = "jdsfl"
|
||||
if err := writeAuthVars(testMode); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestCreateNewCheck(t *testing.T) {
|
||||
if !canTestTrello() {
|
||||
t.Skip("cannot test trello, skipping")
|
||||
}
|
||||
err := trelloCreateNewCheck("Gemini")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdateCheckItem(t *testing.T) {
|
||||
if !canTestTrello() {
|
||||
t.Skip("cannot test trello, skipping")
|
||||
}
|
||||
a, err := trelloGetChecklistItems()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
var checkID string
|
||||
for x := range a.CheckItems {
|
||||
if a.CheckItems[x].Name == "Gemini 1" {
|
||||
checkID = a.CheckItems[x].ID
|
||||
}
|
||||
}
|
||||
err = trelloUpdateCheckItem(checkID, "Gemini 1", "incomplete")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetChecklistItems(t *testing.T) {
|
||||
if !canTestTrello() {
|
||||
t.Skip("cannot test trello, skipping")
|
||||
}
|
||||
_, err := trelloGetChecklistItems()
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSetAuthVars(t *testing.T) {
|
||||
t.Parallel()
|
||||
apiKey = ""
|
||||
configData.Key = ""
|
||||
apiToken = ""
|
||||
configData.Token = ""
|
||||
setAuthVars()
|
||||
if usageData.Key != "" && usageData.Token != "" {
|
||||
t.Errorf("incorrect key and token values")
|
||||
}
|
||||
}
|
||||
|
||||
func TestTrelloDeleteCheckItems(t *testing.T) {
|
||||
if !areTestAPIKeysSet() {
|
||||
t.Skip("API Keys unset, skipping")
|
||||
}
|
||||
err := trelloDeleteCheckItem("")
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTMLScrapeBinance(t *testing.T) {
|
||||
data := HTMLScrapingData{
|
||||
TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "change-log",
|
||||
TextTokenData: "strong",
|
||||
TokenDataEnd: "p",
|
||||
Path: "https://binance-docs.github.io/apidocs/spot/en/#change-log",
|
||||
}
|
||||
_, err := htmlScrapeBinance(&data)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
package main
|
||||
|
||||
// ShaResponse stores raw response from the queries
|
||||
type ShaResponse struct {
|
||||
ShaResp string `json:"sha"`
|
||||
}
|
||||
|
||||
// ExchangeInfo stores exchange info
|
||||
type ExchangeInfo struct {
|
||||
Name string
|
||||
CheckType string
|
||||
Data *CheckData `json:",omitempty"`
|
||||
Disabled bool
|
||||
}
|
||||
|
||||
// CheckData is the necessary data required for checking updates
|
||||
type CheckData struct {
|
||||
HTMLData *HTMLScrapingData `json:",omitempty"`
|
||||
GitHubData *GithubData `json:",omitempty"`
|
||||
}
|
||||
|
||||
// HTMLScrapingData stores input required for extracting latest update data using HTML
|
||||
type HTMLScrapingData struct {
|
||||
TokenData string `json:",omitempty"`
|
||||
Key string `json:",omitempty"`
|
||||
Val string `json:",omitempty"`
|
||||
TokenDataEnd string `json:",omitempty"`
|
||||
TextTokenData string `json:",omitempty"`
|
||||
DateFormat string `json:",omitempty"`
|
||||
RegExp string `json:",omitempty"`
|
||||
CheckString string `json:",omitempty"`
|
||||
Path string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// GithubData stores input required for extracting latest update data
|
||||
type GithubData struct {
|
||||
Repo string `json:",omitempty"`
|
||||
Sha string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// ListData stores trello lists' required data
|
||||
type ListData struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
IDBoard string `json:"idBoard"`
|
||||
}
|
||||
|
||||
// CardFill contains data necessary to create a new card
|
||||
type CardFill struct {
|
||||
Name string
|
||||
Desc string
|
||||
Pos string
|
||||
Due string
|
||||
ListID string
|
||||
MembersID string
|
||||
LabelsID string
|
||||
URLSource string
|
||||
}
|
||||
|
||||
// ItemData stores data of items on a given checklist
|
||||
type ItemData struct {
|
||||
State string `json:"state"`
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Position int64 `json:"pos"`
|
||||
}
|
||||
|
||||
// ChecklistItemData stores items on a given checklist
|
||||
type ChecklistItemData struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
CheckItems []ItemData `json:"checkItems"`
|
||||
}
|
||||
|
||||
// MembersData saves member's data which includes the boards accessible
|
||||
type MembersData struct {
|
||||
Name string `json:"name"`
|
||||
ShortID string `json:"shortlink"`
|
||||
ID string `json:"id"`
|
||||
}
|
||||
|
||||
// Config is a format for storing update data
|
||||
type Config struct {
|
||||
CardID string `json:"CardID"`
|
||||
ChecklistID string `json:"ChecklistID"`
|
||||
ListID string `json:"ListID"`
|
||||
BoardID string `json:"BoardID"`
|
||||
Key string `json:"Key"`
|
||||
Token string `json:"Token"`
|
||||
CreateCardName string
|
||||
CreateListName string
|
||||
CreateChecklistName string
|
||||
Exchanges []ExchangeInfo `json:"Exchanges"`
|
||||
}
|
||||
|
||||
// TrelloData stores data on a given item (board, list, card)
|
||||
type TrelloData struct {
|
||||
ID string `json:"id"`
|
||||
Name string `json:"name"`
|
||||
}
|
||||
@@ -1,391 +0,0 @@
|
||||
{
|
||||
"CardID": "",
|
||||
"ChecklistID": "",
|
||||
"ListID": "",
|
||||
"BoardID": "",
|
||||
"Key": "",
|
||||
"Token": "",
|
||||
"CreateCardName": "",
|
||||
"CreateListName": "",
|
||||
"CreateChecklistName": "",
|
||||
"Exchanges": [
|
||||
{
|
||||
"Name": "Huobi",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "change-log",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006.01.02 15:04",
|
||||
"RegExp": "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
|
||||
"CheckString": "2019.12.27 19:00",
|
||||
"Path": "https://huobiapi.github.io/docs/spot/v1/en/#change-log"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinbasepro",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "ul",
|
||||
"TextTokenData": "strong",
|
||||
"DateFormat": "01/02/06",
|
||||
"RegExp": "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
|
||||
"CheckString": "2/20/20",
|
||||
"Path": "https://docs.pro.coinbase.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Binance",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "binance-exchange/binance-official-api-docs",
|
||||
"Sha": "4878d48adc0075669ba85033b0e2d40c2876cf56"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bithumb",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "bithumb-pro/bithumb.pro-official-api-docs",
|
||||
"Sha": "6293502c7736ab4971491978225ef4d104bdff31"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bittrex",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "Bittrex/bittrex.github.io",
|
||||
"Sha": "fc1ea9c10c48aa82c4dc2c6be74887ef61b5b31b"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinut",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "coinut/api",
|
||||
"Sha": "6936dab4d2beba3c8245a603aebf3f545ebcf3f9"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gateio",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "gateio/gateapi-go",
|
||||
"Sha": "81e2f1bb92c5406853139ae054bbda599483e127"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Lbank",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "LBank-exchange/lbank-official-api-docs",
|
||||
"Sha": "85e7bb83f03d4239c3aad26cabb997a1a2bbb3d1"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTSE",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "btse-spot-api",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h1",
|
||||
"RegExp": "^BTSE Spot API v(\\d){1}.(\\d){1}$",
|
||||
"CheckString": "BTSE Spot API v3.0.2",
|
||||
"Path": "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitfinex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "class",
|
||||
"Val": "header-scroll",
|
||||
"TokenDataEnd": "p",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "section-v-(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2019-08-19",
|
||||
"Path": "https://docs.bitfinex.com/docs/changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "ANX",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "ANX Exchange API v\\d{1}",
|
||||
"CheckString": "ANX Exchange API v3",
|
||||
"Path": "https://anxv3.docs.apiary.io/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Poloniex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "div",
|
||||
"TextTokenData": "h2",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2020-03-24",
|
||||
"Path": "https://docs.poloniex.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "ItBit",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "a",
|
||||
"Key": "href",
|
||||
"RegExp": "^https://api.itbit.com/v\\d{1}/$",
|
||||
"CheckString": "https://api.itbit.com/v1/",
|
||||
"Path": "https://api.itbit.com/docs"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitmex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h4",
|
||||
"Key": "id",
|
||||
"DateFormat": "Jan-2-2006",
|
||||
"RegExp": "([A-Z]{1}[a-z]{2}-\\d{1,2}-2\\d{3})",
|
||||
"CheckString": "Dec-16-2019",
|
||||
"Path": "https://www.bitmex.com/static/md/en-US/apiChangelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "HitBTC",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "about-companyname-api",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "newest version \\d{1}.\\d{1}",
|
||||
"CheckString": "newest version 2.0",
|
||||
"Path": "https://api.hitbtc.com/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTC Markets",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "^version: \\d{1}.\\d{1}.\\d{1}",
|
||||
"CheckString": "version: 3.0.0",
|
||||
"Path": "https://api.btcmarkets.net/openapi/info/index.yaml"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitflyer",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "p",
|
||||
"TokenDataEnd": "h3",
|
||||
"TextTokenData": "code",
|
||||
"RegExp": "^https://api.bitflyer.com/v\\d{1}/$",
|
||||
"CheckString": "https://api.bitflyer.com/v1/",
|
||||
"Path": "https://lightning.bitflyer.com/docs?lang=en"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Exmo",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "Last updated on [\\s\\S]*, 20\\d{2}",
|
||||
"CheckString": "Last updated on December, 16th, 2019",
|
||||
"Path": "https://exmo.com/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Kraken",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h3",
|
||||
"TokenDataEnd": "p",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "URL: https://api.kraken.com/\\d{1}/private/Balance",
|
||||
"CheckString": "URL: https://api.kraken.com/0/private/Balance",
|
||||
"Path": "https://www.kraken.com/features/api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitstamp",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "class",
|
||||
"Val": "text-subtitle mt48",
|
||||
"TokenDataEnd": "h4",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "refer to the v\\d{1} API for future references.",
|
||||
"CheckString": "refer to the v2 API for future references.",
|
||||
"Path": "https://www.bitstamp.net/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "AlphaPoint",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "introduction",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h3",
|
||||
"RegExp": "revised-calls-\\d{1}-\\d{1}-\\d{1}-gt-\\d{1}-\\d{1}-\\d{1}",
|
||||
"CheckString": "revised-calls-3-3-2-gt-3-3-3",
|
||||
"Path": "https://alphapoint.github.io/slate/#introduction"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Yobit",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "id",
|
||||
"CheckString": "v3",
|
||||
"Path": "https://www.yobit.net/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "LocalBitcoins",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "div",
|
||||
"Key": "class",
|
||||
"Val": "col-md-12",
|
||||
"RegExp": "col-md-12([\\s\\S]*?)clearfix",
|
||||
"CheckString": "37a144dc619776b87c098da5a88bef7fed6c8a7cea2d4b9a38c96750726c93ff",
|
||||
"Path": "https://localbitcoins.com/api-docs/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "OkCoin International",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "a",
|
||||
"Key": "href",
|
||||
"Val": "./#change-change",
|
||||
"TokenDataEnd": "./#change-",
|
||||
"RegExp": "./#change-\\d{8}",
|
||||
"CheckString": "20200229",
|
||||
"Path": "https://www.okcoin.com/docs/en/#change-change"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Okex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "a",
|
||||
"Key": "href",
|
||||
"Val": "./#change-change",
|
||||
"TokenDataEnd": "./#change-",
|
||||
"RegExp": "./#change-\\d{8}",
|
||||
"CheckString": "20200331",
|
||||
"Path": "https://www.okex.com/docs/en/#change-change"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gemini",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "revision-history",
|
||||
"TokenDataEnd": "table",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006/01/02",
|
||||
"RegExp": "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
"CheckString": "2020/03/05",
|
||||
"Path": "https://docs.gemini.com/rest-api/#revision-history"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,324 +0,0 @@
|
||||
{
|
||||
"CardID": "",
|
||||
"ChecklistID": "",
|
||||
"ListID": "",
|
||||
"BoardID": "",
|
||||
"Key": "",
|
||||
"Token": "",
|
||||
"CreateCardName": "",
|
||||
"CreateListName": "",
|
||||
"CreateChecklistName": "",
|
||||
"Exchanges": [
|
||||
{
|
||||
"Name": "Huobi",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "change-log",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006.01.02 15:04",
|
||||
"RegExp": "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
|
||||
"CheckString": "2019.12.27 19:00",
|
||||
"Path": "https://huobiapi.github.io/docs/spot/v1/en/#change-log"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinbasepro",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "ul",
|
||||
"TextTokenData": "strong",
|
||||
"DateFormat": "01/02/06",
|
||||
"RegExp": "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
|
||||
"CheckString": "2/20/20",
|
||||
"Path": "https://docs.pro.coinbase.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Binance",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "change-log",
|
||||
"TokenDataEnd": "p",
|
||||
"TextTokenData": "strong",
|
||||
"CheckString": "2020-05-06",
|
||||
"Path": "https://binance-docs.github.io/apidocs/spot/en/#change-log"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bithumb",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "bithumb-pro/bithumb.pro-official-api-docs",
|
||||
"Sha": "6293502c7736ab4971491978225ef4d104bdff31"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinut",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "coinut/api",
|
||||
"Sha": "6936dab4d2beba3c8245a603aebf3f545ebcf3f9"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gateio",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "gateio/gateapi-go",
|
||||
"Sha": "81e2f1bb92c5406853139ae054bbda599483e127"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Lbank",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "LBank-exchange/lbank-official-api-docs",
|
||||
"Sha": "85e7bb83f03d4239c3aad26cabb997a1a2bbb3d1"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTSE",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "btse-spot-api",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h1",
|
||||
"RegExp": "^BTSE Spot API v(\\d){1}.(\\d){1}$",
|
||||
"CheckString": "BTSE Spot API v3.0.2",
|
||||
"Path": "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitfinex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "class",
|
||||
"Val": "header-scroll",
|
||||
"TokenDataEnd": "p",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "section-v-(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2019-08-19",
|
||||
"Path": "https://docs.bitfinex.com/docs/changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "ANX",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "ANX Exchange API v\\d{1}",
|
||||
"CheckString": "ANX Exchange API v3",
|
||||
"Path": "https://anxv3.docs.apiary.io/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Poloniex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "div",
|
||||
"TextTokenData": "h2",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2020-03-24",
|
||||
"Path": "https://docs.poloniex.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitmex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h4",
|
||||
"Key": "id",
|
||||
"DateFormat": "Jan-2-2006",
|
||||
"RegExp": "([A-Z]{1}[a-z]{2}-\\d{1,2}-2\\d{3})",
|
||||
"CheckString": "Dec-16-2019",
|
||||
"Path": "https://www.bitmex.com/static/md/en-US/apiChangelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "HitBTC",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "about-companyname-api",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "newest version \\d{1}.\\d{1}",
|
||||
"CheckString": "newest version 2.0",
|
||||
"Path": "https://api.hitbtc.com/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTC Markets",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "^version: \\d{1}.\\d{1}.\\d{1}",
|
||||
"CheckString": "version: 3.0.0",
|
||||
"Path": "https://api.btcmarkets.net/openapi/info/index.yaml"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitflyer",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "p",
|
||||
"TokenDataEnd": "h3",
|
||||
"TextTokenData": "code",
|
||||
"RegExp": "^https://api.bitflyer.com/v\\d{1}/$",
|
||||
"CheckString": "https://api.bitflyer.com/v1/",
|
||||
"Path": "https://lightning.bitflyer.com/docs?lang=en"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Exmo",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "Last updated on [\\s\\S]*, 20\\d{2}",
|
||||
"CheckString": "Last updated on December, 16th, 2019",
|
||||
"Path": "https://exmo.com/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Kraken",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h3",
|
||||
"TokenDataEnd": "p",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "URL: https://api.kraken.com/\\d{1}/private/Balance",
|
||||
"CheckString": "URL: https://api.kraken.com/0/private/Balance",
|
||||
"Path": "https://www.kraken.com/features/api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitstamp",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "class",
|
||||
"Val": "text-subtitle mt48",
|
||||
"TokenDataEnd": "h4",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "refer to the v\\d{1} API for future references.",
|
||||
"CheckString": "refer to the v2 API for future references.",
|
||||
"Path": "https://www.bitstamp.net/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "AlphaPoint",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "introduction",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h3",
|
||||
"RegExp": "revised-calls-\\d{1}-\\d{1}-\\d{1}-gt-\\d{1}-\\d{1}-\\d{1}",
|
||||
"CheckString": "revised-calls-3-3-2-gt-3-3-3",
|
||||
"Path": "https://alphapoint.github.io/slate/#introduction"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Yobit",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "id",
|
||||
"CheckString": "v3",
|
||||
"Path": "https://www.yobit.net/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gemini",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "revision-history",
|
||||
"TokenDataEnd": "table",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006/01/02",
|
||||
"RegExp": "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
"CheckString": "2020/03/05",
|
||||
"Path": "https://docs.gemini.com/rest-api/#revision-history"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,324 +0,0 @@
|
||||
{
|
||||
"CardID": "",
|
||||
"ChecklistID": "",
|
||||
"ListID": "",
|
||||
"BoardID": "",
|
||||
"Key": "",
|
||||
"Token": "",
|
||||
"CreateCardName": "",
|
||||
"CreateListName": "",
|
||||
"CreateChecklistName": "",
|
||||
"Exchanges": [
|
||||
{
|
||||
"Name": "Huobi",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "change-log",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006.01.02 15:04",
|
||||
"RegExp": "^20(\\d){2}.(\\d){2}.(\\d){2} (\\d){2}:(\\d){2}$",
|
||||
"CheckString": "2019.12.27 19:00",
|
||||
"Path": "https://huobiapi.github.io/docs/spot/v1/en/#change-log"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinbasepro",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "ul",
|
||||
"TextTokenData": "strong",
|
||||
"DateFormat": "01/02/06",
|
||||
"RegExp": "^(\\d){1,2}/(\\d){1,2}/(\\d){2}$",
|
||||
"CheckString": "2/20/20",
|
||||
"Path": "https://docs.pro.coinbase.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Binance",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "change-log",
|
||||
"TokenDataEnd": "p",
|
||||
"TextTokenData": "strong",
|
||||
"CheckString": "2020-05-06",
|
||||
"Path": "https://binance-docs.github.io/apidocs/spot/en/#change-log"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bithumb",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "bithumb-pro/bithumb.pro-official-api-docs",
|
||||
"Sha": "6293502c7736ab4971491978225ef4d104bdff31"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Coinut",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "coinut/api",
|
||||
"Sha": "6936dab4d2beba3c8245a603aebf3f545ebcf3f9"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gateio",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "gateio/gateapi-go",
|
||||
"Sha": "81e2f1bb92c5406853139ae054bbda599483e127"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Lbank",
|
||||
"CheckType": "GitHub Sha Check",
|
||||
"Data": {
|
||||
"GitHubData": {
|
||||
"Repo": "LBank-exchange/lbank-official-api-docs",
|
||||
"Sha": "85e7bb83f03d4239c3aad26cabb997a1a2bbb3d1"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTSE",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "btse-spot-api",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h1",
|
||||
"RegExp": "^BTSE Spot API v(\\d){1}.(\\d){1}$",
|
||||
"CheckString": "BTSE Spot API v3.0.2",
|
||||
"Path": "https://www.btse.com/apiexplorer/spot/#btse-spot-api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitfinex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "class",
|
||||
"Val": "header-scroll",
|
||||
"TokenDataEnd": "p",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "section-v-(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2019-08-19",
|
||||
"Path": "https://docs.bitfinex.com/docs/changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "ANX",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "ANX Exchange API v\\d{1}",
|
||||
"CheckString": "ANX Exchange API v3",
|
||||
"Path": "https://anxv3.docs.apiary.io/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Poloniex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "changelog",
|
||||
"TokenDataEnd": "div",
|
||||
"TextTokenData": "h2",
|
||||
"DateFormat": "2006-01-02",
|
||||
"RegExp": "(2\\d{3}-\\d{1,2}-\\d{1,2})",
|
||||
"CheckString": "2020-03-24",
|
||||
"Path": "https://docs.poloniex.com/#changelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitmex",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h4",
|
||||
"Key": "id",
|
||||
"DateFormat": "Jan-2-2006",
|
||||
"RegExp": "([A-Z]{1}[a-z]{2}-\\d{1,2}-2\\d{3})",
|
||||
"CheckString": "Dec-16-2019",
|
||||
"Path": "https://www.bitmex.com/static/md/en-US/apiChangelog"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "HitBTC",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "about-companyname-api",
|
||||
"TokenDataEnd": "h2",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "newest version \\d{1}.\\d{1}",
|
||||
"CheckString": "newest version 2.0",
|
||||
"Path": "https://api.hitbtc.com/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "BTC Markets",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "^version: \\d{1}.\\d{1}.\\d{1}",
|
||||
"CheckString": "version: 3.0.0",
|
||||
"Path": "https://api.btcmarkets.net/openapi/info/index.yaml"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitflyer",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "p",
|
||||
"TokenDataEnd": "h3",
|
||||
"TextTokenData": "code",
|
||||
"RegExp": "^https://api.bitflyer.com/v\\d{1}/$",
|
||||
"CheckString": "https://api.bitflyer.com/v1/",
|
||||
"Path": "https://lightning.bitflyer.com/docs?lang=en"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Exmo",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"RegExp": "Last updated on [\\s\\S]*, 20\\d{2}",
|
||||
"CheckString": "Last updated on December, 16th, 2019",
|
||||
"Path": "https://exmo.com/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Kraken",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h3",
|
||||
"TokenDataEnd": "p",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "URL: https://api.kraken.com/\\d{1}/private/Balance",
|
||||
"CheckString": "URL: https://api.kraken.com/0/private/Balance",
|
||||
"Path": "https://www.kraken.com/features/api"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Bitstamp",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "class",
|
||||
"Val": "text-subtitle mt48",
|
||||
"TokenDataEnd": "h4",
|
||||
"TextTokenData": "p",
|
||||
"RegExp": "refer to the v\\d{1} API for future references.",
|
||||
"CheckString": "refer to the v2 API for future references.",
|
||||
"Path": "https://www.bitstamp.net/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "AlphaPoint",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "introduction",
|
||||
"TokenDataEnd": "blockquote",
|
||||
"TextTokenData": "h3",
|
||||
"RegExp": "revised-calls-\\d{1}-\\d{1}-\\d{1}-gt-\\d{1}-\\d{1}-\\d{1}",
|
||||
"CheckString": "revised-calls-3-3-2-gt-3-3-3",
|
||||
"Path": "https://alphapoint.github.io/slate/#introduction"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Yobit",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h2",
|
||||
"Key": "id",
|
||||
"CheckString": "v3",
|
||||
"Path": "https://www.yobit.net/en/api/"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
},
|
||||
{
|
||||
"Name": "Gemini",
|
||||
"CheckType": "HTML String Check",
|
||||
"Data": {
|
||||
"HTMLData": {
|
||||
"TokenData": "h1",
|
||||
"Key": "id",
|
||||
"Val": "revision-history",
|
||||
"TokenDataEnd": "table",
|
||||
"TextTokenData": "td",
|
||||
"DateFormat": "2006/01/02",
|
||||
"RegExp": "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
"CheckString": "2020/03/05",
|
||||
"Path": "https://docs.gemini.com/rest-api/#revision-history"
|
||||
}
|
||||
},
|
||||
"Disabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
{{define "cmd apichecker" -}}
|
||||
{{template "header" .}}
|
||||
## Current Features for {{.Name}}
|
||||
|
||||
+ Checks for API updates
|
||||
+ Can automatically update Trello checklist for the updates required
|
||||
+ Supports trello integration
|
||||
|
||||
#### This tool tracks changes in exchange API documentation
|
||||
#### Keeps track of all the updates using the GoCryptoTrader trello board
|
||||
|
||||
Be aware, this tool will:
|
||||
- Automatically update the live trello board if API keys and trello information are provided.
|
||||
- Automatically update the main json updates file, however a backup of the copy before the updates will be stored.
|
||||
|
||||
## Usage
|
||||
|
||||
+ To run a real check for updates, parse Trello API info as flags or add them to the updates.json file and use the following command from apichecker folder in GCT:
|
||||
|
||||
###### Linux/OSX
|
||||
GoCryptoTrader is built using [Go Modules](https://github.com/golang/go/wiki/Modules) and requires Go 1.11 or above
|
||||
Using Go Modules you now clone this repository **outside** your GOPATH
|
||||
|
||||
```bash
|
||||
git clone https://github.com/thrasher-corp/gocryptotrader.git
|
||||
cd gocryptotrader/cmd/apichecker
|
||||
go build
|
||||
./apichecker
|
||||
```
|
||||
|
||||
###### Windows
|
||||
|
||||
```bash
|
||||
git clone https://github.com/thrasher-corp/gocryptotrader.git
|
||||
cd gocryptotrader\cmd\apichecker
|
||||
go build && apichecker.exe
|
||||
```
|
||||
|
||||
+ Upon addition of a new exchange, to update Trello checklist and to add the exchange to updates.json the following would need to be done:
|
||||
|
||||
###### HTML Scraping method:
|
||||
HTMLScrapingData is a struct which contains the necessary information to scrape data from the given path website. Not all the elements of HTMLScrapingData are necessary, its all dependent on site where information is being extracted from. Regexp is used to capture necessary bits of data using r.FindString() where r is the declared regular expression. If update dates data is available, DateFormat is used to convert the dates to a more standard format which can then be used for further comparisons of which update is most recent.
|
||||
```go
|
||||
func TestAdd(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := HTMLScrapingData{TokenData: "h1",
|
||||
Key: "id",
|
||||
Val: "revision-history",
|
||||
TokenDataEnd: "table",
|
||||
TextTokenData: "td",
|
||||
DateFormat: "2006/01/02",
|
||||
RegExp: "^20(\\d){2}/(\\d){2}/(\\d){2}$",
|
||||
CheckString: "2019/11/15",
|
||||
Path: "https://docs.gemini.com/rest-api/#revision-history"}
|
||||
err := Add("Gemini", htmlScrape, data.Path, data, true, &testConfigData)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
###### Github SHA Check Method:
|
||||
```go
|
||||
func TestAdd(t *testing.T) {
|
||||
t.Parallel()
|
||||
data := GithubData{Repo: "LBank-exchange/lbank-official-api-docs"}
|
||||
err := Add("Lbank", github, fmt.Sprintf(githubPath, data.Repo), data, false, &configData)
|
||||
if err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
###### Add using flags:
|
||||
```bash
|
||||
apichecker.exe -add=true -key=id -val=revision-history -tokendata=h1 -tokendataend=table -texttokendata=td -dateformat=2006/01/02 -checktype="HTML String Check" -regexp="^20(\d){2}/(\d){2}/(\d){2}$" -path="https://docs.gemini.com/rest-api/#revision-history" -exchangename=Gemini
|
||||
```
|
||||
|
||||
+ If all the authentication variables for trello are set trello checklist will be automatically updated with the format of 'Exchange Name (integer of how many updates have been released since the exchange API was last worked on):
|
||||
|
||||
- To acquire your trello key and access token please login into trello using the following link and follow the steps: https://trello.com/app-key
|
||||
|
||||
- To acquire BoardID, ListID, CardID and ChecklistID inbuilt functions can be used such as trelloGetAllLists()
|
||||
|
||||
- To create a new list, card, checklist, and to populate the the checklist --create flag can be used.
|
||||
|
||||
- To create a new check within a checklist, an inbuilt function within apichecker can be used: trelloCreateNewCheck
|
||||
|
||||
- For the first time running the application & to create a list, card and checklist use the following:
|
||||
```bash
|
||||
apichecker.exe --create -apikey="insertkeyhere" -apitoken="inserttokenhere" -boardname="insertboardnamehere"
|
||||
```
|
||||
|
||||
|
||||
### Please click GoDocs chevron above to view current GoDoc information for this package
|
||||
{{template "contributions"}}
|
||||
{{template "donations" .}}
|
||||
{{end}}
|
||||
Reference in New Issue
Block a user