Skip to content

Commit e5f44fb

Browse files
committed
clean up code
1 parent 62fa601 commit e5f44fb

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

update-gist.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,20 @@ async function updateGist(data) {
3737
}
3838

3939
const lines = [];
40-
lines.push('🦇🦇 **BADMAN Todoist Stats** 🦇🦇\n');
40+
lines.push('🦇🦇 BADMAN Todoist Stats 🦇🦇');
41+
lines.push('');
4142
const { karma, completed_count, days_items, week_items, goals } = data;
42-
if (karma !== undefined) lines.push(`🦸‍♂️ **${formatNumber(karma)}** Karma Points`);
43-
if (days_items && days_items[0]) lines.push(`🌃 **${formatNumber(days_items[0].total_completed)}** tasks completed tonight`);
44-
if (week_items && week_items[0]) lines.push(`🦹‍♂️ **${formatNumber(week_items[0].total_completed)}** tasks completed this week`);
45-
if (completed_count !== undefined) lines.push(`🦇 **${formatNumber(completed_count)}** tasks completed so far`);
46-
if (goals && goals.last_daily_streak) lines.push(`🦾 **${formatNumber(goals.last_daily_streak.count)}**-night streak`);
47-
lines.push('\n🦇🦇🦇🦇🦇🦇🦇\n');
43+
if (karma !== undefined) lines.push(`🦸‍♂️ ${formatNumber(karma)} Karma Points`);
44+
if (days_items && days_items[0]) lines.push(`🌃 ${formatNumber(days_items[0].total_completed)} tasks completed tonight`);
45+
if (week_items && week_items[0]) lines.push(`🦹‍♂️ ${formatNumber(week_items[0].total_completed)} tasks completed this week`);
46+
if (completed_count !== undefined) lines.push(`🦇 ${formatNumber(completed_count)} tasks completed so far`);
47+
if (goals && goals.last_daily_streak) lines.push(`🦾 ${formatNumber(goals.last_daily_streak.count)}-night streak`);
48+
lines.push('');
49+
lines.push('🦇🦇🦇🦇🦇🦇🦇');
50+
lines.push('');
4851
lines.push('"The night is darkest just before the dawn. And I promise you, the dawn is coming."');
4952
lines.push('"All men have limits. They learn what they are and learn not to exceed them. I ignore mine."');
50-
lines.push(`\n_Updated at ${new Date().toLocaleString()}_`);
53+
lines.push('');
5154

5255
if (lines.length === 0) return;
5356

@@ -57,7 +60,7 @@ async function updateGist(data) {
5760
gist_id: gistId,
5861
files: {
5962
[filename]: {
60-
filename: ` Todoist Stats.md`,
63+
filename: ` Todoist Stats.txt`,
6164
content: lines.join("\n"),
6265
},
6366
},

0 commit comments

Comments
 (0)