Skip to content

Commit cce0362

Browse files
committed
Added more post fields to notification
1 parent f3266ce commit cce0362

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

server/src/feedMonitor.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class FeedMonitor {
102102
matchedKeywords
103103
};
104104

105-
await this.sendNotification(item);
105+
await this.sendNotification(item, matchedKeywords);
106106

107107
// Update history entry to reflect sent notification
108108
historyEntry.notificationSent = true;
@@ -148,7 +148,7 @@ export class FeedMonitor {
148148
}
149149
}
150150

151-
private async sendNotification(item: FeedItem) {
151+
private async sendNotification(item: FeedItem, matchedKeywords: string[]) {
152152
const config = this.configManager.getConfig();
153153
const ntfyUrl = `${config.ntfyServerAddress}/${config.ntfyTopic}`;
154154
const sanitizedTitle = item.title.replace(/[^\x20-\x7E]/g, '');
@@ -162,7 +162,9 @@ export class FeedMonitor {
162162
body: item.description,
163163
headers: {
164164
'Title': sanitizedTitle,
165-
'Priority': 'low'
165+
'Priority': 'low',
166+
'Tags': matchedKeywords.join(','),
167+
'Actions': `view, Open, ${item.link}`
166168
}
167169
});
168170
} catch (error) {
@@ -233,6 +235,6 @@ export class FeedMonitor {
233235
link: config.ntfyServerAddress,
234236
pubDate: new Date().toISOString()
235237
};
236-
await this.sendNotification(testItem);
238+
await this.sendNotification(testItem, ["keyword1", "keyword2"]);
237239
}
238240
}

server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class Server {
128128
this.server = this.app.listen(port, () => {
129129
console.log(`
130130
╔═══════════════════════════════════════════╗
131-
RSS Watcher
131+
RSS Watcher
132132
╚═══════════════════════════════════════════╝
133133
🚀 Server is running on port ${port}
134134
📡 Mode: ${process.env.NODE_ENV || 'production'}

0 commit comments

Comments
 (0)