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 Trend collection 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

  1. YouTube transcript fetch & clean — provide a YouTube link, the worker fetches captions/transcript, cleans timestamps and returns top soundbites.
  2. Article scraping & extraction — submit an article URL; the collector extracts the main content and highlights quotable lines.
  3. Trend injection — fresh keywords from Twitter/Reddit/GoogleTrends are stored with TTL and injected into generated variants.
  4. JSON-based prompting — the frontend sends a structured payload and receives predictable, testable LLM output variants.
  5. Fast vs High-quality modes — low-latency templates for quick output or LLM summarization for premium results.
  6. TweetHistory — saved outputs for iteration and reuse.

Demo flow

  1. Open the demo UI (TweetGenerator).
  2. Paste a YouTube link or article URL.
  3. Select fast mode and click Generate to see quick variants (template-driven).
  4. Switch to high-quality mode to run the LLM summarizer + injection and generate more polished tweets.
  5. Show TweetHistory and 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

  1. Embedding-based keyword relevance for better context matching.
  2. More robust YT speaker diarization to extract multi-speaker highlights.
  3. Integrations for direct scheduling/posting (Twitter/X, Mastodon).
  4. UX polish: tone presets, hashtag suggestions, and inline editing of injected keywords.

How to run locally

  1. Clone repo and install: git clone <repo> && cd viralonx && npm install
  2. .env.local must include MONGODB_URI, COHERE_API_KEY, optional YOUTUBE_API_KEY.
  3. Start dev server: npm run dev
  4. Workers: node workers/transcriptWorker.js (example)

  • Owner / Demo: Ishaan Kumar

Built With

Share this project:

Updates