summary refs log tree commit diff stats
path: root/cmd/cetus-bing
diff options
context:
space:
mode:
authorAndinus <andinus@inventati.org>2020-03-15 17:29:01 +0530
committerAndinus <andinus@inventati.org>2020-03-15 17:29:01 +0530
commitba8d3148ee99d18db4d6e3e69981b7e29b6e392f (patch)
tree9d0534237a4fcadb7a2df6f0926cc45e19559ea1 /cmd/cetus-bing
parenta22d31258ff92d8b2e199e1bdd6e898c6519c707 (diff)
downloadcetus-ba8d3148ee99d18db4d6e3e69981b7e29b6e392f.tar.gz
cetus-bing: Correct date format v0.4.5
Diffstat (limited to 'cmd/cetus-bing')
-rw-r--r--cmd/cetus-bing/cetus-bing.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/cmd/cetus-bing/cetus-bing.go b/cmd/cetus-bing/cetus-bing.go
index e4aae89..9b06379 100644
--- a/cmd/cetus-bing/cetus-bing.go
+++ b/cmd/cetus-bing/cetus-bing.go
@@ -63,7 +63,18 @@ func main() {
 	// responses, choose a random response from the list
 	var i int = rand.Intn(len(bpodRes.Photos))
 	bpodPhoto = bpodRes.Photos[i]
+
+	// correct image path
 	bpodPhoto.URL = fmt.Sprintf("%s%s", "https://www.bing.com", bpodPhoto.URL)
+
+	// correct date format
+	var dt time.Time
+	dt, err = time.Parse("20060102", bpodPhoto.StartDate)
+	if err != nil {
+		log.Fatal(err)
+	}
+	bpodPhoto.StartDate = dt.Format("2006-01-02")
+
 	printDetails(bpodPhoto)
 
 	// if fetchOnly is true then don't set background
@@ -105,7 +116,7 @@ func printDetails(bpodPhoto bing.Photo) {
 	fmt.Printf("Copyright: %s\n", bpodPhoto.Copyright)
 	fmt.Printf("Copyright Link: %s\n", bpodPhoto.CopyrightLink)
 	fmt.Printf("Date: %s\n\n", bpodPhoto.StartDate)
-	fmt.Printf("URL: %s\n\n", bpodPhoto.URL)
+	fmt.Printf("URL: %s\n", bpodPhoto.URL)
 }
 
 func getBPODRes() (bing.BPOD, error) {
reorg C++ mu to use layers' href='/akkartik/mu/commit/cpp/literate/002trace.tests?h=hlt&id=515309164793b2e03c15954bf8a89f0f288a7f2c'>51530916 ^
35064671 ^

5af83346 ^
51530916 ^

5af83346 ^
35064671 ^

5af83346 ^
51530916 ^

5af83346 ^
35064671 ^
5af83346 ^
51530916 ^

d7494165 ^
35064671 ^
d7494165 ^


51530916 ^
35064671 ^


5af83346 ^
51530916 ^

51530916 ^
35064671 ^

51530916 ^



35064671 ^

51530916 ^


eba30983 ^
35064671 ^
4c569925 ^
eba30983 ^

51530916 ^

36594a43 ^
5f98a10c ^

36594a43 ^
5f98a10c ^
51530916 ^
51530916 ^




05d17773 ^
51530916 ^




05d17773 ^
51530916 ^




05d17773 ^

51530916 ^




05d17773 ^


51530916 ^




05d17773 ^


51530916 ^
d7494165 ^















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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124