ItBit: Remove exchange implementation (#1463)

This commit is contained in:
Adrian Gallagher
2024-02-15 10:40:02 +11:00
committed by GitHub
parent 08da42ddb7
commit 9f968151be
25 changed files with 1 additions and 2225 deletions

View File

@@ -38,7 +38,6 @@ const (
pathBitmex = "https://www.bitmex.com/static/md/en-US/apiChangelog"
pathANX = "https://anxv3.docs.apiary.io/"
pathPoloniex = "https://docs.poloniex.com/#changelog"
pathIbBit = "https://api.itbit.com/docs"
pathBTCMarkets = "https://api.btcmarkets.net/openapi/info/index.yaml"
pathEXMO = "https://exmo.com/en/api/"
pathBitstamp = "https://www.bitstamp.net/api/"
@@ -468,8 +467,6 @@ func checkChangeLog(htmlData *HTMLScrapingData) (string, error) {
dataStrings, err = htmlScrapeANX(htmlData)
case pathPoloniex:
dataStrings, err = htmlScrapePoloniex(htmlData)
case pathIbBit:
dataStrings, err = htmlScrapeItBit(htmlData)
case pathBTCMarkets:
dataStrings, err = htmlScrapeBTCMarkets(htmlData)
case pathEXMO:
@@ -963,41 +960,6 @@ loop:
return resp, nil
}
// htmlScrapeItBit gets the check string for ItBit Exchange
func htmlScrapeItBit(htmlData *HTMLScrapingData) ([]string, error) {
var resp []string
temp, err := sendHTTPGetRequest(htmlData.Path, nil)
if err != nil {
return nil, err
}
defer temp.Body.Close()
tokenizer := html.NewTokenizer(temp.Body)
loop:
for {
next := tokenizer.Next()
switch next {
case html.ErrorToken:
break loop
case html.StartTagToken:
token := tokenizer.Token()
if token.Data == htmlData.TokenData {
for _, z := range token.Attr {
if z.Key == htmlData.Key {
r, err := regexp.Compile(htmlData.RegExp)
if err != nil {
return resp, err
}
if r.MatchString(z.Val) {
resp = append(resp, z.Val)
}
}
}
}
}
}
return resp, nil
}
// htmlScrapeBitstamp gets the check string for Bitstamp Exchange
func htmlScrapeBitstamp(htmlData *HTMLScrapingData) ([]string, error) {
temp, err := sendHTTPGetRequest(htmlData.Path, nil)

View File

@@ -317,21 +317,6 @@ func TestHTMLPoloniex(t *testing.T) {
}
}
func TestHTMLItBit(t *testing.T) {
t.Parallel()
data := HTMLScrapingData{TokenData: "a",
Key: "href",
Val: "changelog",
TokenDataEnd: "div",
TextTokenData: "h2",
DateFormat: "2006-01-02",
RegExp: `^https://api.itbit.com/v\d{1}/$`,
Path: "https://api.itbit.com/docs"}
if _, err := htmlScrapeItBit(&data); err != nil {
t.Error(err)
}
}
func TestHTMLScrapeExmo(t *testing.T) {
t.Parallel()
data := HTMLScrapingData{RegExp: `Last updated on [\s\S]*, 20\d{2}`,

View File

@@ -169,20 +169,6 @@
},
"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",

View File

@@ -169,20 +169,6 @@
},
"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",