From 913ee49fa0a5fad0d0ce4097d5fc52eb745c36cc Mon Sep 17 00:00:00 2001 From: kondoumh Date: Sun, 6 Dec 2020 17:35:20 +0900 Subject: [PATCH] output views and linked --- cmd/graph.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/graph.go b/cmd/graph.go index c86f8b3..9c647c7 100644 --- a/cmd/graph.go +++ b/cmd/graph.go @@ -13,8 +13,10 @@ import ( ) type page struct { - ID string `json:"id"` - Title string `json:"title"` + ID string `json:"id"` + Title string `json:"title"` + Views int `json:"views"` + Linked int `json:"linked"` } type user struct { @@ -110,7 +112,7 @@ func buildGraph(cmd *cobra.Command) { for _, p := range pages { gid := graph.AddNode(p.Title) pNodes[p.ID] = gid - pGraph.Pages = append(pGraph.Pages, page{p.ID, p.Title}) + pGraph.Pages = append(pGraph.Pages, page{p.ID, p.Title, p.Views, p.Linked}) } uNodes := map[string]int{} if includeUser {