package main

import (
    "encoding/json"
    "fmt"
    "net/http"
)

func main() {
    url := "https://api.64clouds.com/v1/getServiceInfo?veid=823669&api_key=private_xt5IHIYNAhuYxkFlvLpCWTGc"
    resp, err := http.Get(url)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()
    var data map[string]interface{}
    err = json.NewDecoder(resp.Body).Decode(&data)
    if err != nil {
        panic(err)
    }

    data_counter, ok := data["data_counter"].(float64)
    if !ok {
        return
    }
    v := data_counter / 1024.0 / 1024.0 / 1024.0
    fmt.Printf("%.2fGB/500.00GB\n", v)
}

标签: none

添加新评论