ViralonX — HackSocial Submission
Elevator pitch: Turn long-form content and real-time trends into bite-sized, shareable tweets in seconds. ViralonX fetches YouTube transcripts and website articles, extracts high-signal lines, injects fresh trending keywords, and generates tweet variants via structured (JSON) prompts so creators can publish fast.
Problem
Creators spend hours hunting for trending topics and reshaping long-form content into short, engaging posts. Finding the most quotable lines inside videos/articles and making them feel timely is manual, slow, and error-prone.
Solution
ViralonX automates content discovery and social copy generation by combining three practical pieces:
- Content extraction: automatic YouTube transcript fetching and robust article parsing to produce clean text input.
- Fresh trends: lightweight collectors that store short-term keywords in a TTLed
Trendcollection so generated copy uses only current signals. - Structured generation: JSON-based prompts drive predictable LLM outputs, enabling fast templating and higher-quality LLM passes when needed.
The result: creators paste a URL or text, choose fast/high-quality mode, and receive multiple tweet-ready variants (with injected trend keywords) they can copy or save.
Key features
- YouTube transcript fetch & clean — provide a YouTube link, the worker fetches captions/transcript, cleans timestamps and returns top soundbites.
- Article scraping & extraction — submit an article URL; the collector extracts the main content and highlights quotable lines.
- Trend injection — fresh keywords from Twitter/Reddit/GoogleTrends are stored with TTL and injected into generated variants.
- JSON-based prompting — the frontend sends a structured payload and receives predictable, testable LLM output variants.
- Fast vs High-quality modes — low-latency templates for quick output or LLM summarization for premium results.
- TweetHistory — saved outputs for iteration and reuse.
Demo flow
- Open the demo UI (
TweetGenerator). - Paste a YouTube link or article URL.
- Select
fastmode and click Generate to see quick variants (template-driven). - Switch to
high-qualitymode to run the LLM summarizer + injection and generate more polished tweets. - Show
TweetHistoryand how trend keywords are surfaced alongside each variant.
Tip: use a recent, high-signal video/article for best results (e.g., a trending tech talk or a viral explainer).
Architecture
[Sources: YouTube / Articles / Twitter / Reddit / GoogleTrends]
↓
[Collectors & Extractors (workers) - fetch transcripts & clean HTML]
↓
[Trend DB (TTL)] [Content DB (extracted lines)]
↓ ↓
[Generation API] ←——— merge keywords + JSON prompt
↓
[LLM / Templates] → post-filter → TweetHistory
↓
[Frontend: TweetGenerator & TweetHistory]
How we use YouTube transcripts & articles
- YouTube transcripts: fetch captions via API/scrape; normalize text; strip timestamps; detect speaker boundaries if available; run lightweight sentence-scoring heuristics to find soundbites.
- Articles: use a main-content extractor (readability-like algorithm) to remove boilerplate; extract title, lead, and candidate sentences; compute simple heuristics (position, numbers, quotes) to surface high-value lines.
- Both sources undergo extractive summarization before any free-form LLM rewriting to reduce hallucination.
JSON-based prompts (short)
ViralonX sends a structured JSON payload to the /api/generate endpoint. This payload contains the input (summary or candidate line), keywords to inject, mode (fast|high), tone, max_length, variants, and constraints.
Why this matters for a hackathon: JSON prompts make generation deterministic and testable. They also allow us to A/B tone, mode, and examples programmatically during the demo.
Tech stack
- Frontend: React / Next.js (components:
TweetGenerator,TweetHistory) - Backend: Node.js (API endpoints in
pages/api/generate) - DB: MongoDB (TTL indexes for
Trend&Viral) - Workers: Node workers for scraping and transcript fetching
- LLM: Cohere / OpenAI (JSON-based prompts, mode-based token budgets)
Novelty & Advantages
- Focuses on existing, high-signal content (transcripts & articles) rather than noisy feed aggregation.
- Uses short TTLed trend buffers to keep injections topical without heavy storage or complex ranking.
- JSON-based prompts improve reproducibility and make experimentation during a 48–72 hour hackathon tractable.
Metrics & early validation
(If available during the hackathon, measure the following)
- Time saved per creator (minutes to publish a tweet)
- Variant acceptance rate (percentage of generated variants users keep)
- Click-through / engagement lift on injected vs non-injected tweets (A/B test)
Roadmap
- Embedding-based keyword relevance for better context matching.
- More robust YT speaker diarization to extract multi-speaker highlights.
- Integrations for direct scheduling/posting (Twitter/X, Mastodon).
- UX polish: tone presets, hashtag suggestions, and inline editing of injected keywords.
How to run locally
- Clone repo and install:
git clone <repo> && cd viralonx && npm install .env.localmust includeMONGODB_URI,COHERE_API_KEY, optionalYOUTUBE_API_KEY.- Start dev server:
npm run dev - Workers:
node workers/transcriptWorker.js(example)
- Owner / Demo: Ishaan Kumar
Built With
- cheerio
- cohere-ai
- css
- extractus/article-extractor
- javascript
- jsdom
- lucide-react
- mongodb
- mongoose
- mozilla/readability
- natural
- next.js
- node-fetch
- node.js
- openai
- railway
- react
- redditapi
- snoowrap
- tailwind
- trends24
- typescript
- youtube-transcript
Log in or sign up for Devpost to join the conversation.