• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
sunnyatlightswitch

sunnyatlightswitch

reddit-checker

Public
Like
1
reddit-checker
Home
Code
2
README.md
H
unified-reddit-monitor.ts
Branches
1
Pull requests
Remixes
1
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
6/24/2025
Viewing readonly version of main branch: v77
View latest version
README.md

Unified Reddit Monitor

A simplified, comprehensive Reddit monitoring system that consolidates all monitoring functionality into a single script. No more cron jobs or constant notifications!

πŸš€ Features

  • 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
  • Manual Execution: Run only when you want - no automated scheduling
  • Robust Error Handling: Continues monitoring even if some subreddits fail
  • Comprehensive Logging: Detailed console output for debugging

πŸ“ Clean Project Structure

β”œβ”€β”€ unified-reddit-monitor.ts  # 🎯 MAIN SCRIPT - Run this manually (HTTP) βœ… READY
└── README.md                  # This file

All legacy files have been removed! The project now contains only the essential unified monitoring script.

🎯 How to Use

Run the Monitor (Manual Execution)

Simply visit the HTTP endpoint to run the monitor:

GET /unified-reddit-monitor.ts

Available Actions

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

βš™οΈ Configuration

Current Settings βœ… CONFIGURED

  • 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
  • Post Limit: 25 posts per subreddit per check
  • Notifications: Both Slack and Email enabled
  • Execution: Manual only - no automated scheduling

Reddit API Credentials βœ… CONFIGURED

  • Client ID: 151sZ8h5TaHVZGZZn0rOhA
  • Client Secret: rX_YGngVjaxRA3Y0F3STl2cuEmgHkQ

πŸ”§ Usage

Primary Usage βœ… READY

Run the unified monitor manually when you want to check for new posts:

GET /unified-reddit-monitor.ts

Configuration Management

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

Legacy Testing Tools (Optional)

These are kept for backward compatibility but not needed for normal operation:

GET /test-reddit-api.ts?action=help            # Test Reddit API connection
GET /test-slack.ts?action=simple               # Test Slack notifications
GET /config-manager.ts                         # View configuration details

πŸ“± Notifications βœ… CONFIGURED

When matches are found, you'll receive notifications via:

Slack Notifications

  • 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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

Email Notifications

  • 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

πŸ” Monitoring Details

What Gets Monitored

  • Post Titles: Full text search for keywords across all 11 subreddits
  • Post Content: Self-text content of posts across all subreddits
  • Frequency: Manual execution only (no automated scheduling)
  • Scope: New posts since last check across all monitored subreddits
  • Methods: Reddit API (primary), JSON API (fallback), RSS feeds (last resort)

Keyword Matching βœ… TESTED

  • Case-insensitive matching
  • Partial word matching (e.g., "auth" matches "authentication")
  • Multiple keyword detection per post
  • Configurable keyword list

πŸ› οΈ Customization

To modify the configuration, edit the CONFIG object in unified-reddit-monitor.ts:

Adding New Keywords

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 };

Adding New Subreddits

const CONFIG: MonitorConfig = { subreddits: [ "lovable", "AppBusiness", "appdev", "AppDevelopers", "ChatGPTCoding", "indiehackers", "microsaas", "replit", "ReplitBuilders", "vibecoding", "ViralApps", "YOUR_NEW_SUBREDDIT" // Add here ], // ... other settings };

Adjusting 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 };

πŸ” Security

  • 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

βœ… System Status

Current Status: FULLY OPERATIONAL - SIMPLIFIED ARCHITECTURE

  • βœ… Unified Script: Single comprehensive monitoring script
  • βœ… No Cron Jobs: Manual execution only - no more constant notifications
  • βœ… Multi-Method Fetching: Reddit API β†’ JSON API β†’ RSS fallbacks
  • βœ… Multi-Subreddit Support: 11 subreddits monitored simultaneously
  • βœ… Dual Notifications: Both Slack and email working
  • βœ… Robust Error Handling: Continues even if some subreddits fail
  • βœ… Comprehensive Logging: Detailed execution information

How to Use

  1. Run When Needed: Visit /unified-reddit-monitor.ts to check for new posts
  2. Check Status: Use ?action=status to see current configuration
  3. Reset if Needed: Use ?action=reset to clear last checked timestamp
  4. Get Help: Use ?action=help for usage information

Legacy Files (Disabled)

All old monitoring scripts have been disabled (no cron triggers):

  • ❌ reddit-api-monitor.ts (no cron)
  • ❌ reddit-monitor.ts (no cron)
  • ❌ reddit-rss-monitor.ts (no cron)

Test files remain available for debugging if needed.

πŸ› Troubleshooting

Common Issues

  1. 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
  2. API Errors

    • The script automatically falls back to JSON API then RSS
    • Check the response for detailed error information
  3. Notification Issues

    • Slack and email can be individually enabled/disabled in config
    • Check spam folder for emails
    • Verify Slack webhook URL is working

Debug Information

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

πŸ“Š Benefits of Unified Approach

βœ… Simplified Management: One script instead of multiple cron jobs βœ… Reduced Notifications: Run only when you want updates βœ… Better Reliability: Multiple fallback methods for fetching posts βœ… Comprehensive Logging: See exactly what's happening βœ… Error Resilience: Continues working even if some subreddits fail βœ… Easy Configuration: All settings in one place

FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.