twitterCompetitorMonitoring
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.
index.ts
https://charmaine--9dfa14dc55d911f08fcaf69ea79377d9.web.val.run
A web application for searching and monitoring tweets mentioning your competitors using powerful OR query statements.
├── backend/
│ └── index.ts (http) # Main HTTP API and static file server
├── frontend/
│ └── index.html # Web interface for searching tweets
└── README.md
TWITTER_BEARER_TOKEN: Your Twitter API bearer token for searching tweets
- Go to developer.twitter.com and create a developer account
- Create a new app in the Twitter Developer Portal
- Navigate to the "Keys and tokens" tab
- Generate a Bearer Token
- Set the
TWITTER_BEARER_TOKENenvironment variable in Val Town with this token
- Set up the
TWITTER_BEARER_TOKENenvironment variable with your Twitter API bearer token. - Visit the web interface to enter custom search queries.
- Use OR statements to search for multiple competitors at once.
- View real-time results from the last 7 days.
"@competitor1" OR "@competitor2" OR "@competitor3"
"competitor.com" OR "rival.io" OR "alternative.ai"
"@openai" OR "chatgpt" OR "claude" OR "@anthropic" OR "openai.com"
("@competitor1" OR "competitor1.com") AND (product OR launch OR announcement)
- 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
GET /- Main web interfacePOST /api/search- Search tweets with custom queryGET /api/health- Check API configuration status
Each tweet result includes:
- Author name and username
- Tweet content
- Creation timestamp
- Engagement metrics (likes, retweets, replies)
- Direct link to original tweet
- Retweet indicator