summary refs log tree commit diff stats
path: root/pkg/apod/print.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/apod/print.go')
-rw-r--r--pkg/apod/print.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/apod/print.go b/pkg/apod/print.go
new file mode 100644
index 0000000..a087665
--- /dev/null
+++ b/pkg/apod/print.go
@@ -0,0 +1,19 @@
+package apod
+
+import (
+	"fmt"
+)
+
+// Print will print the json output
+func Print(res Res) {
+	fmt.Printf("Title: %s\n\n", res.Title)
+	fmt.Printf("Copyright: %s\n", res.Copyright)
+	fmt.Printf("Date: %s\n\n", res.Date)
+	fmt.Printf("Media Type: %s\n", res.MediaType)
+	if res.MediaType == "image" {
+		fmt.Printf("URL: %s\n\n", res.HDURL)
+	} else {
+		fmt.Printf("URL: %s\n\n", res.URL)
+	}
+	fmt.Printf("Explanation: %s\n", res.Explanation)
+}
span> ^
4a943d4e ^
6f6d458f ^

4a943d4e ^
83c67014 ^
4a943d4e ^












caaeccd6 ^

83c67014 ^
c442a5ad ^
caaeccd6 ^





03d50cc8 ^
caaeccd6 ^




03d50cc8 ^
caaeccd6 ^
















caaeccd6 ^



























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
87
88
89
90
91
92
93
94
95