Skip to content

Commit

Permalink
output views and linked
Browse files Browse the repository at this point in the history
  • Loading branch information
kondoumh committed Dec 6, 2020
1 parent b1d2376 commit 913ee49
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 913ee49

Please sign in to comment.