Competitor Tweet Monitor

A web application for searching and monitoring tweets mentioning your competitors using powerful OR query statements.

Project Structure

├── backend/
│   └── index.ts (http)      # Main HTTP API and static file server
├── frontend/
│   └── index.html          # Web interface for searching tweets
└── README.md

Environment Variables

Required

  • TWITTER_BEARER_TOKEN: Your Twitter API bearer token for searching tweets

Getting a Twitter API Token

  1. Go to developer.twitter.com and create a developer account
  2. Create a new app in the Twitter Developer Portal
  3. Navigate to the "Keys and tokens" tab
  4. Generate a Bearer Token
  5. Set the TWITTER_BEARER_TOKEN environment variable in Val Town with this token

How to Use

  1. Set up the TWITTER_BEARER_TOKEN environment variable with your Twitter API bearer token.
  2. Visit the web interface to enter custom search queries.
  3. Use OR statements to search for multiple competitors at once.
  4. View real-time results from the last 7 days.

Query Examples

Multiple Twitter Accounts

"@competitor1" OR "@competitor2" OR "@competitor3"

Domain Names

"competitor.com" OR "rival.io" OR "alternative.ai"

Mixed Queries

"@openai" OR "chatgpt" OR "claude" OR "@anthropic" OR "openai.com"

Advanced Queries

("@competitor1" OR "competitor1.com") AND (product OR launch OR announcement)

Features

  • Interactive Web Interface: Easy-to-use form for entering custom queries
  • OR Query Support: Search multiple competitors simultaneously
  • Real-time Results: Get tweets from the last 7 days instantly
  • Rich Tweet Display: Shows author, content, metrics, and direct links
  • Quick Examples: Pre-built query templates for common use cases
  • Responsive Design: Works on desktop and mobile devices
  • Error Handling: Clear feedback for API issues or invalid queries

API Endpoints

  • GET / - Main web interface
  • POST /api/search - Search tweets with custom query
  • GET /api/health - Check API configuration status

Tweet Data Included

Each tweet result includes:

  • Author name and username
  • Tweet content
  • Creation timestamp
  • Engagement metrics (likes, retweets, replies)
  • Direct link to original tweet
  • Retweet indicator