X Farsi Analyzer
Language-aware Chrome extension for studying coordinated messaging, engagement, and sentiment in Persian-language timelines on X.

Pipeline Architecture
The analyzer is composed of three integrated modules: (1) DOM Observer + Scraper to collect tweets, (2) Farsi Processor for language normalization and tokenization, and (3) Analytics Engine to extract insights on content, sentiment, and networks.
Module 1 — Scraper & DOM Observer
Captures dynamic tweet data directly from user profiles. Uses a MutationObserver and Scroll Manager to load tweets automatically while avoiding duplicates. Extracts tweet text, author details, media, and metrics with Farsi/RTL support.
Module 2 — Farsi Text Processing Pipeline
Cleans and normalizes Persian script, detects mixed languages and Finglish, handles ZWNJ and digit conversion, and outputs tokenized text ready for analysis. Achieves 94–100 % accuracy with < 50 ms per tweet processing time.
Module 3 — Analytics Engine
Runs six analyzers (word frequency, sentiment, engagement, temporal patterns, hashtags, and mention network). Uses Web Workers and LRU cache for fast client-side processing of 1000 tweets in under 5 seconds.
Analytics Capabilities
Word Frequency
TF-IDF and token statistics
Sentiment Analyzer
Bilingual lexicon (FA/EN) classification
Engagement Calc
Ratios of likes/retweets/replies
Posting Patterns
Temporal trends + Persian calendar support
Hashtag Analyzer
Co-occurrence and reach estimation
Mention Network
Interaction graph and influence scores
Performance & Results
- Processed 1500 tweets across 5 profiles with 97 % Farsi detection accuracy.
- 1000-tweet analysis completes in < 5 seconds using Web Worker parallelization.
- 33 % cache hit rate on repeated analyses with LRU manager.
- Export formats available: JSON and CSV.
Engineering Note
Highlight borders originally caused gaps between tweets in Twitter’s flex layout. The next update will replace borders with absolute overlay badges to preserve alignment while maintaining visual feedback.
Ethics & Privacy
All data collection runs client-side and is user-initiated. No information is transmitted to external servers. The tool is designed for academic and public-interest research on platform transparency and information integrity.