Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Do not tweet on Sunday (#712)

Thomas Kaulca46a9827a58
diff --git a/apps/api/src/services/twitter-bot/twitter-bot.service.ts b/apps/api/src/services/twitter-bot/twitter-bot.service.ts
index 750e4fe309..b183122793 100644
--- a/apps/api/src/services/twitter-bot/twitter-bot.service.ts
+++ b/apps/api/src/services/twitter-bot/twitter-bot.service.ts
@@ -6,6 +6,7 @@ import {
} from '@ghostfolio/common/config';
import { resolveFearAndGreedIndex } from '@ghostfolio/common/helper';
import { Injectable, Logger } from '@nestjs/common';
+import { isSunday } from 'date-fns';
import { TwitterApi, TwitterApiReadWrite } from 'twitter-api-v2';
@Injectable()
@@ -27,7 +28,10 @@ export class TwitterBotService {
}
public async tweetFearAndGreedIndex() {
- if (!this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX')) {
+ if (
+ !this.configurationService.get('ENABLE_FEATURE_FEAR_AND_GREED_INDEX') ||
+ isSunday(new Date())
+ ) {
return;
}