Skip to content

Commit a3c6a3b

Browse files
committed
Collection of Labels
1 parent 91c88d2 commit a3c6a3b

File tree

1 file changed

+229
-0
lines changed

1 file changed

+229
-0
lines changed

lib/cli/label.js

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
const say = require("../sayings/threads.json"); // sayings
2+
const { color, txt } = require("./helper");
3+
const pkg = require("../../package.json"); // package.json info
4+
const { space, line, br, tab } = txt;
5+
6+
const randomSay = () => say[Math.floor(Math.random() * say.length)];
7+
8+
exports.randomSay = randomSay;
9+
10+
const source = "Source: https://www.worldometers.info/coronavirus/",
11+
repo = "Code: https://github.com/warengonzaga/covid19-tracker-cli",
12+
help = "Help: Try to append the URL with /help to learn more...",
13+
bmcurl = "warengonza.ga/coffee4dev",
14+
twitterhandle = "@warengonzaga",
15+
twitterhashtag = "#covid19trackercli",
16+
bmc = "(Buy Me A Coffee) ",
17+
bmcline = "Love this project? Help us to help others by means of coffee!",
18+
twitterline = "Follow me on twitter for more updates!",
19+
gcashNum = "+639176462753",
20+
ansiBMC = color.redBright("(Buy Me A Coffee) " + bmcurl),
21+
ansiTwitter =
22+
color.cyanBG(color.black(twitterhandle)) +
23+
space +
24+
color.cyanBG(color.black(twitterhashtag)),
25+
gCash = "(GCash) ",
26+
ansiGCash = color.cyan(gCash + gcashNum),
27+
title = {
28+
global: "COVID-19 Tracker CLI v" + pkg.version + " - Global Update",
29+
country: (name) =>
30+
"COVID-19 Tracker CLI v" + pkg.version + " - " + name + " Update",
31+
globalHistory:
32+
"COVID-19 Tracker CLI v" + pkg.version + " - Global Historical Chart",
33+
history: (name) =>
34+
`COVID-19 Tracker CLI v ${pkg.version} - ${name} Historical Chart`,
35+
},
36+
asOfDate = (asof, currentdate) => "As of " + asof.toLocaleString() + " [Date:" + currentdate + "]",
37+
footerOne = br + br + " " + line + br + " " + bmcline + br + " ",
38+
footerTwo = br + " " + line + br + " " + twitterline + br + " ",
39+
defaultFooter = footerOne + ansiBMC + footerTwo + ansiTwitter + br + br,
40+
specialFooter =
41+
footerOne +
42+
ansiGCash +
43+
br +
44+
" " +
45+
ansiBMC +
46+
footerTwo +
47+
ansiTwitter +
48+
br +
49+
br,
50+
plainDefaultFooter =
51+
br +
52+
tab +
53+
line +
54+
br +
55+
tab +
56+
bmcline +
57+
br +
58+
tab +
59+
bmc +
60+
bmcurl +
61+
br +
62+
tab +
63+
line +
64+
br +
65+
tab +
66+
twitterline +
67+
br +
68+
tab +
69+
twitterhandle +
70+
space +
71+
twitterhashtag +
72+
br +
73+
br,
74+
plainCountryDefaultFooter =
75+
br +
76+
tab +
77+
line +
78+
br +
79+
tab +
80+
bmcline +
81+
br +
82+
tab +
83+
bmc +
84+
bmcurl +
85+
br +
86+
tab +
87+
line +
88+
br +
89+
tab +
90+
twitterline +
91+
br +
92+
tab +
93+
twitterhandle +
94+
space +
95+
twitterhashtag +
96+
br +
97+
br,
98+
plainCountrySpecialFooter =
99+
br +
100+
tab +
101+
line +
102+
br +
103+
tab +
104+
bmcline +
105+
br +
106+
tab +
107+
gCash +
108+
gcashNum +
109+
br +
110+
tab +
111+
bmc +
112+
bmcurl +
113+
br +
114+
tab +
115+
line +
116+
br +
117+
tab +
118+
twitterline +
119+
br +
120+
tab +
121+
twitterhandle +
122+
space +
123+
twitterhashtag +
124+
br +
125+
br,
126+
manual = `
127+
${line}
128+
COVID-19 Tracker CLI v${pkg.version} by Waren Gonzaga
129+
${line}
130+
131+
Basic Usage:
132+
133+
/<country name> ................... by country stats
134+
ex. /philippines /korea
135+
/<ISO 3166-1 code> ................ by country stats shortcut
136+
ex. /ph /kor
137+
138+
/cmd .............................. if using CMD
139+
/cmd/<country name> ............... by country stats on CMD
140+
/cmd/<ISO 3166-1 code> ............ by country stats shortcut on CMD
141+
142+
/plain or /basic .................. if your cli does not support ANSI encoding
143+
similar to /cmd usage and layout
144+
ex. /plain/philippines or /plain/ph
145+
/basic/philippines or /basic/ph
146+
147+
${line}
148+
149+
ANSI Supported Features
150+
151+
/history/ or /history/all ......... historical chart globally
152+
153+
/history/<country name> ........... historical chart for cases of a country
154+
ex. /history/philippines /history/korea
155+
/history/<ISO 3166-1 code> ........ shortcut historical chart for cases of a country
156+
ex. /history/ph /history/kor
157+
158+
Cases and Deaths is currently available for historical chart.
159+
160+
/history/ph/cases or /history/ph/deaths
161+
162+
${line}
163+
164+
To learn more about the usage... please visit
165+
https://warengonza.ga/covid19-tracker-cli
166+
167+
ISO 3166-1 Code List:
168+
https://warengonza.ga/iso-3166-1-codes
169+
170+
${line}
171+
${repo}
172+
${line}
173+
174+
${randomSay()}
175+
`,
176+
helpMenu =
177+
manual +
178+
br +
179+
tab +
180+
line +
181+
br +
182+
tab +
183+
bmcline +
184+
br +
185+
tab +
186+
bmc +
187+
bmcurl +
188+
br +
189+
tab +
190+
txt.line +
191+
br +
192+
tab +
193+
twitterline +
194+
br +
195+
tab +
196+
twitterhandle +
197+
space +
198+
twitterhashtag +
199+
br +
200+
br;
201+
202+
exports.labels = {
203+
pkg,
204+
source,
205+
repo,
206+
help,
207+
bmcurl,
208+
twitterhandle,
209+
twitterhashtag,
210+
bmc,
211+
bmcline,
212+
twitterline,
213+
gCash,
214+
gcashNum,
215+
ansiBMC,
216+
ansiTwitter,
217+
ansiGCash,
218+
title,
219+
asOfDate,
220+
footerOne,
221+
footerTwo,
222+
defaultFooter,
223+
specialFooter,
224+
plainDefaultFooter,
225+
plainCountryDefaultFooter,
226+
plainCountrySpecialFooter,
227+
manual,
228+
helpMenu,
229+
};

0 commit comments

Comments
 (0)