• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
jamiedubs

jamiedubs

twitterCompetitorMonitoring

it costs like $5k month for basic social listening tools lol
Remix of jamiedubs/twitterAlert
Public
Like
1
twitterCompetitorMonitoring
Home
Code
6
utils
1
views
3
README.md
H
api.ts
db.ts
C
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
1
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
/
Code
/
Search
api.ts
https://jamiedubs--cd4e981834ee11f095e59e149126039e.web.val.run
README.md

Competitor Tweet Tracker

This Val Town project tracks tweets mentioning competitor URLs and visualizes the data in charts.

Project Structure

├── main.tsx (cron)          # Hourly cron job to collect tweet data
├── api.ts (http)            # HTTP API and static file server
├── db.ts                    # Database operations and schema
├── utils/
│   └── competitors.ts       # Competitor configuration utilities
└── views/
    ├── index.html          # Main HTML template
    └── charts.js           # Chart rendering JavaScript

Environment Variables

Required

  • TWITTER_BEARER_TOKEN: Your Twitter API bearer token for searching tweets

Optional

  • COMPETITORS: Comma-separated list of competitor hostnames to track (default: val.town)

    Examples:

    • val.town (default)
    • val.town,poe.com,shapes.inc
    • poe.com,character.ai,pi.ai,coze.com,gumloop.com,n8n.io

Popular Competitor Suggestions

Here are some popular competitors you might want to track:

val.town,poe.com,character.ai,pi.ai,coze.com,gumloop.com,n8n.io,shapes.inc,manus.im,genspark.ai

Components

  1. Cron Job (main.tsx): Runs hourly to search Twitter for mentions of competitor URLs and stores the results in a database.
  2. Database (db.ts): Uses SQLite to store tweet data and provides functions to query the data.
  3. Web Interface (api.ts): Serves the HTML page and provides API endpoints for chart data.
  4. Views (views/): Contains the HTML template and JavaScript for rendering charts.

How to Use

  1. Set up the TWITTER_BEARER_TOKEN environment variable with your Twitter API bearer token.
  2. Optionally set the COMPETITORS environment variable with your list of competitors to track.
  3. The cron job will automatically run every hour to collect data.
  4. Visit the HTTP endpoint to view the charts showing tweet counts.

Features

  • Tracks tweets mentioning competitor URLs
  • Configurable competitor list via environment variables
  • Avoids double-counting tweets by storing unique tweet IDs
  • Visualizes data in daily trend charts and total count charts
  • Automatically updates as new data is collected
  • Separated HTML/CSS/JS from API logic for better maintainability
HTTP
  • api.ts
    jamiedubs--cd…9e.web.val.run
Cron
  • main.tsx
Code
utilsviewsREADME.md
H
api.ts
db.ts
C
main.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.