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

sunnyatlightswitch

reddit-checker

Public
Like
1
reddit-checker
Home
Code
11
README.md
H
config-manager.ts
reddit-api-monitor.ts
reddit-monitor.ts
reddit-rss-monitor.ts
H
test-main-monitor.ts
H
test-reddit-api.ts
H
test-reddit-monitor.ts
H
test-rss-monitor.ts
H
test-slack.ts
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: v66
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

πŸ“ Simplified Project Structure

β”œβ”€β”€ unified-reddit-monitor.ts  # 🎯 MAIN SCRIPT - Run this manually (HTTP) βœ… READY
β”œβ”€β”€ test-reddit-api.ts         # API testing tool (HTTP) - Legacy
β”œβ”€β”€ test-main-monitor.ts       # Manual testing tool (HTTP) - Legacy  
β”œβ”€β”€ test-slack.ts              # Slack webhook testing tool (HTTP) - Legacy
β”œβ”€β”€ config-manager.ts          # Configuration management (HTTP) - Legacy
β”œβ”€β”€ reddit-api-monitor.ts      # Old API monitor (NO CRON) - Legacy
β”œβ”€β”€ reddit-monitor.ts          # Old JSON monitor (NO CRON) - Legacy
β”œβ”€β”€ reddit-rss-monitor.ts      # Old RSS monitor (NO CRON) - Legacy
β”œβ”€β”€ test-rss-monitor.ts        # RSS testing tool (HTTP) - Legacy
└── README.md                  # This file

🎯 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

βœ… System Status

Current Status: FULLY OPERATIONAL WITH MULTI-SUBREDDIT SUPPORT

  • βœ… Reddit API authentication working
  • βœ… Post fetching functional across multiple subreddits
  • βœ… Keyword matching operational
  • βœ… Slack notifications configured and tested
  • βœ… Timestamp tracking working
  • βœ… Multi-subreddit monitoring (11 subreddits)
  • βœ… All Slack webhook formats working (simple, Reddit posts, errors)

Next Steps

  1. Set Cron Schedule: Configure the automatic run frequency in Val Town UI
  2. Monitor Slack: Check for notification messages when matches are found across all subreddits
  3. Customize as Needed: Adjust keywords or add/remove subreddits based on requirements

πŸ› Troubleshooting

Common Issues

  1. Authentication Errors

    • βœ… Resolved: Credentials are properly configured
  2. No Matches Found

    • βœ… Verified: System successfully finds matches (tested with 4 matches)
  3. Email Not Received

    • Check spam folder
    • Verify Val Town email configuration
    • Check monitor logs for errors

Debug Tools βœ… ALL WORKING

  • Use test-reddit-api.ts to verify API connectivity
  • Use test-main-monitor.ts to run the monitor manually
  • Check Val Town logs for detailed error information

πŸ“Š Recent Test Results

  • API Connection: βœ… Successful
  • Authentication: βœ… Working
  • Post Fetching: βœ… Retrieved posts from multiple subreddits
  • Keyword Matching: βœ… Found matches with updated keyword list
  • Multi-Subreddit Support: βœ… Now monitoring 11 subreddits simultaneously
  • Slack Integration: βœ… All notification types working
    • Simple messages: βœ… Working
    • Reddit post notifications: βœ… Working with subreddit identification
    • Error notifications: βœ… Working

πŸ”„ Backup Options

The project includes an RSS-based monitor (reddit-rss-monitor.ts) as a backup option if the API approach encounters issues. The RSS monitor has similar functionality but uses Reddit's RSS feeds instead of the official API.

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.