Skip to content

Commit

Permalink
fix sana_client
Browse files Browse the repository at this point in the history
  • Loading branch information
AKB428 committed May 9, 2022
1 parent b93bd55 commit 9a87da5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ anime_api_server
anime_api_server_linux
.vscode
/gen/gen
/tool/sana_client
/tool/sana_client
/tool/*.csv
15 changes: 14 additions & 1 deletion tool/sana_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ package main

import (
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"

"github.com/Project-ShangriLa/anime_api_golang/model"
)

// go build -o sana_client
Expand Down Expand Up @@ -51,5 +54,15 @@ func main() {
panic(err)
}

fmt.Println(string(body))
twhs := []model.TwitterStatusHistory{}

json.Unmarshal(body, &twhs)

//fmt.Println(string(body))

for _, v := range twhs {
r := fmt.Sprintf("%s,%d", v.GetDate.Format("2006-01-02"), v.Follower)
println(r)
}

}

0 comments on commit 9a87da5

Please sign in to comment.