From 5d15226d9d6891ae611aa7922f24ed5f0dd13cde Mon Sep 17 00:00:00 2001 From: Andinus Date: Mon, 16 Mar 2020 14:09:43 +0530 Subject: cetus-wallhaven: Print additional information, fix logical error --- cmd/cetus-wallhaven/cetus-wallhaven.go | 47 +++++++++++++++++----------------- 1 file changed, 24 insertions(+), 23 deletions(-) (limited to 'cmd/cetus-wallhaven') diff --git a/cmd/cetus-wallhaven/cetus-wallhaven.go b/cmd/cetus-wallhaven/cetus-wallhaven.go index 5314db9..8c6c928 100644 --- a/cmd/cetus-wallhaven/cetus-wallhaven.go +++ b/cmd/cetus-wallhaven/cetus-wallhaven.go @@ -18,32 +18,32 @@ type wh struct { } // type meta struct { -// CurrentPage int64 `json:"current_page"` -// LastPage int64 `json:"last_page"` -// PerPage int64 `json:"per_page"` -// Total int64 `json:"total"` +// CurrentPage int `json:"current_page"` +// LastPage int `json:"last_page"` +// PerPage int `json:"per_page"` +// Total int `json:"total"` // Query string `json:"query"` // Seed string `json:"seed"` // } type photo struct { - Id string `json:"id"` - Url string `json:"url"` - ShortUrl string `json:"short_url"` - // Views int `json:"views"` - // Favorites int `json:"favorites"` - Source string `json:"source"` - Purity string `json:"purity"` - Category string `json:"general"` - // DimensionX int `json:"dimension_x"` - // DimensionY int `json:"dimension_y"` - Resolution string `json:"resolution"` - Ratio string `json:"ratio"` - // FileSize int `json:"file_size"` - FileType string `json:"file_type"` - CreatedAt string `json:"created_at"` - Path string `json:"path"` - Colors []string `json:"colors"` + Id string `json:"id"` + Url string `json:"url"` + ShortUrl string `json:"short_url"` + Views int `json:"views"` + Favorites int `json:"favorites"` + Source string `json:"source"` + Purity string `json:"purity"` + Category string `json:"category"` + DimensionX int `json:"dimension_x"` + DimensionY int `json:"dimension_y"` + Resolution string `json:"resolution"` + Ratio string `json:"ratio"` + FileSize int `json:"file_size"` + FileType string `json:"file_type"` + CreatedAt string `json:"created_at"` + Path string `json:"path"` + Colors []string `json:"colors"` // Thumbs []thumb `json:"thumbs"` } @@ -134,8 +134,9 @@ func printDetails(whPhoto photo) { fmt.Printf("Date: %s\n\n", whPhoto.CreatedAt) fmt.Printf("Resolution: %s\n", whPhoto.Resolution) fmt.Printf("Ratio: %s\n", whPhoto.Ratio) - // fmt.Printf("Views: %s\n", whPhoto.Views) - // fmt.Printf("Favorites: %s\n", whPhoto.Favorites) + fmt.Printf("Views: %d\n", whPhoto.Views) + fmt.Printf("Favorites: %d\n", whPhoto.Favorites) + fmt.Printf("File Size: %d KiB\n", whPhoto.FileSize/1024) fmt.Printf("Category: %s\n", whPhoto.Category) } -- cgit 1.4.1-2-gfad0 an up source tree' href='/gbmor/getwtxt/commit/svc/post.go?h=v0.4.5&id=fd43c61bd128ad77b22db0537a9a4eb58490b0b5'>fd43c61 ^
df1d1ef ^



79c5696 ^
df1d1ef ^










824556a ^
df1d1ef ^

37be25f ^
df1d1ef ^


824556a ^
df1d1ef ^




37142b5 ^
df1d1ef ^
824556a ^
df1d1ef ^


824556a ^

79c5696 ^



c896e6b ^
df1d1ef ^
55c8ffa ^
824556a ^


df1d1ef ^
df1d1ef ^
824556a ^


df1d1ef ^
37142b5 ^
824556a ^
79c5696 ^
824556a ^
df1d1ef ^
824556a ^






df1d1ef ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86