A simplified, comprehensive Reddit monitoring system that consolidates all monitoring functionality into a single script with automated cron scheduling!
- Unified Monitoring: Single script handles all Reddit monitoring
- Multiple Methods: Uses Reddit API with JSON and RSS fallbacks for reliability
- Multi-Subreddit Support: Monitors 11 subreddits simultaneously
- Dual Notifications: Sends both Slack and email notifications
- Database Storage: Automatically saves matching posts to Supabase database
- Automated Scheduling: Runs on cron schedule for consistent monitoring
- Manual Override: Can also be run manually when needed
- Robust Error Handling: Continues monitoring even if some subreddits fail
- Comprehensive Logging: Detailed console output for debugging
āāā unified-reddit-monitor.ts # šÆ MAIN SCRIPT - Runs on cron schedule (CRON) ā
READY
āāā README.md # This file
All legacy files have been removed! The project now contains only the essential unified monitoring script.
The monitor runs automatically on a cron schedule. Set your preferred schedule in the Val Town web UI:
Recommended Schedules:
*/30 * * * *
- Every 30 minutes (active monitoring)0 * * * *
- Every hour (balanced)0 */2 * * *
- Every 2 hours (moderate)0 */4 * * *
- Every 4 hours (conservative)0 9,21 * * *
- Twice daily at 9 AM and 9 PM
You can also run the monitor manually anytime by visiting the HTTP endpoint:
GET /unified-reddit-monitor.ts
GET /unified-reddit-monitor.ts?action=run # Run the monitor (default)
GET /unified-reddit-monitor.ts?action=status # Show current configuration
GET /unified-reddit-monitor.ts?action=reset # Reset last checked timestamp
GET /unified-reddit-monitor.ts?action=help # Show help information
- Subreddits: 11 subreddits monitored
r/lovable
,r/AppBusiness
,r/appdev
,r/AppDevelopers
r/ChatGPTCoding
,r/indiehackers
,r/microsaas
,r/replit
r/ReplitBuilders
,r/vibecoding
,r/ViralApps
- Keywords:
- Authentication:
auth
,authentication
,login
,user sessions
- Monetization:
stripe
,subscriptions
,monetization
,paywall
,feature gating
- Analytics:
analytics
- Business:
how do I make money with my app
- Authentication:
- Post Limit: 25 posts per subreddit per check
- Notifications: Both Slack and Email enabled
- Database: Supabase integration enabled
- Execution: Automated cron scheduling + manual override capability
- Client ID:
151sZ8h5TaHVZGZZn0rOhA
- Client Secret:
rX_YGngVjaxRA3Y0F3STl2cuEmgHkQ
Automated: The monitor runs automatically on your configured cron schedule.
Manual Override: Run the monitor manually anytime:
GET /unified-reddit-monitor.ts
GET /unified-reddit-monitor.ts?action=status # View current settings
GET /unified-reddit-monitor.ts?action=reset # Reset last checked timestamp
GET /unified-reddit-monitor.ts?action=help # Show help and usage
When matches are found, the system will:
- Header:
šØ Unified Reddit Monitor Alert: X new matching posts in Y subreddits
- Rich Attachments for each matching post including:
- Post title (clickable link to Reddit)
- Matched keywords
- Author information
- Score and comment count
- Publication date
- Content preview
- Subreddit footer
- Webhook URL:
https://hooks.slack.com/services/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
- Subject:
šØ Unified Reddit Monitor Alert: X new matches in Y subreddits
- Content: Formatted text with all post details
- Format: Both plain text and HTML versions
- Table:
relevant_reddit_posts
- Fields Stored:
title
(text) - Post titleauthor
(text) - Reddit usernamekeywords_found
(text) - Comma-separated matched keywordscomments
(text) - Number of commentsposted
(text) - ISO timestamp when postedurl
(text) - Full Reddit URL
- Project:
ffilnpatwtlzjrfbmvxk.supabase.co
- Post Titles: Full text search for keywords across all 11 subreddits
- Post Content: Self-text content of posts across all subreddits
- Frequency: Automated cron execution + manual override capability
- Scope: New posts since last check across all monitored subreddits
- Methods: Reddit API (primary), JSON API (fallback), RSS feeds (last resort)
- Case-insensitive matching
- Partial word matching (e.g., "auth" matches "authentication")
- Multiple keyword detection per post
- Configurable keyword list
To modify the configuration, edit the CONFIG
object in unified-reddit-monitor.ts
:
const CONFIG: MonitorConfig = {
keywords: [
'auth', 'authentication', 'login', 'user sessions',
'stripe', 'subscriptions', 'monetization',
'paywall', 'feature gating', 'analytics',
'how do I make money with my app',
'YOUR_NEW_KEYWORD' // Add here
],
// ... other settings
};
const CONFIG: MonitorConfig = {
subreddits: [
"lovable", "AppBusiness", "appdev", "AppDevelopers",
"ChatGPTCoding", "indiehackers", "microsaas", "replit",
"ReplitBuilders", "vibecoding", "ViralApps",
"YOUR_NEW_SUBREDDIT" // Add here
],
// ... other settings
};
const CONFIG: MonitorConfig = {
postLimit: 50, // Check 50 posts per subreddit instead of 25
useSlack: true, // Enable/disable Slack notifications
useEmail: false, // Enable/disable email notifications
// ... other settings
};
- Reddit API credentials are configured and working
- Access tokens are cached and automatically refreshed
- All API calls use proper authentication headers
- Fallback methods ensure reliability even if primary API fails
- ā Single Script: One comprehensive monitoring script only
- ā No Legacy Files: All unnecessary files removed
- ā Automated Scheduling: Runs consistently on cron schedule
- ā Manual Override: Can still be run manually when needed
- ā Multi-Method Fetching: Reddit API ā JSON API ā RSS fallbacks
- ā Multi-Subreddit Support: 11 subreddits monitored simultaneously
- ā Triple Output: Slack notifications + Email alerts + Database storage
- ā Robust Error Handling: Continues even if some subreddits fail
- ā Comprehensive Logging: Detailed execution information
- Set Cron Schedule: Configure your preferred schedule in Val Town web UI
- Monitor Automatically: The script runs on schedule and sends notifications
- Manual Override: Visit
/unified-reddit-monitor.ts
to run immediately - Check Status: Use
?action=status
to see current configuration - Reset if Needed: Use
?action=reset
to clear last checked timestamp - Get Help: Use
?action=help
for usage information
The project now contains only the essential unified monitoring script. All legacy files, test files, and redundant components have been removed for maximum simplicity and maintainability.
-
No Recent Matches
- Check if there are actually new posts with your keywords
- Use
?action=status
to see when last checked - Use
?action=reset
to check all posts again
-
API Errors
- The script automatically falls back to JSON API then RSS
- Check the response for detailed error information
-
Notification Issues
- Slack and email can be individually enabled/disabled in config
- Check spam folder for emails
- Verify Slack webhook URL is working
The unified script provides comprehensive logging:
- Shows which method was used for each subreddit (API/JSON/RSS)
- Reports errors per subreddit but continues with others
- Provides detailed match information
- Shows notification sending status
ā
Consistent Coverage: Never miss new posts with automated scheduling
ā
Hands-Free Operation: Set it once and let it run automatically
ā
Flexible Control: Manual override available when needed
ā
Maximum Simplicity: Single script handles everything
ā
Easy Maintenance: One file to manage and update
ā
Reliable Operation: Multiple fallback methods with robust error handling