تحليل عميق لتغريدة واحدة: كشف الذكاء الاصطناعي، توافقية خوارزمية X، وتوصيات للتحسين
Single-tweet deep diagnostics: AI detection, X-algorithm fit, and improvement suggestions
محلّل التغريدات الذكي v3.0 تطبيق ويب يُحلّل تغريدة واحدة عبر 8 أبعاد تشخيصية بدون أي خادم أو API خارجي. كل المعالجة تتم محلياً في متصفحك.
- 🤖 كشف الذكاء الاصطناعي: 9 إشارات استدلالية موزونة تُقدّر احتمالية كون النص مكتوباً بـ LLM
- 🐦 توافقية خوارزمية X: محرك تنبؤ مُصمَّم وفق
xai-org/x-algorithmيحسب درجة التوافق عبر 15 احتمال تفاعل - 🪄 مُحسِّن ذكي: 3 إعادات صياغة (أقصر / سؤال / إيجابي) مع درجة جديدة متوقعة لكل واحدة
- ⚔️ مقارنة A/B بين تغريدتين
- 🗂️ سجل التحليلات (آخر 20)
- 🖼️ بطاقة مشاركة PNG بكل النتائج
نتيجة 0-100 مع مستوى ثقة (low/medium/high يعتمد على طول النص). تعتمد على 9 إشارات موزونة:
| الإشارة | الوزن | الفكرة |
|---|---|---|
| تباين أطوال الجمل (Burstiness) | 18% | LLM تنتج جملاً منتظمة، البشر يتفاوتون |
| تنوّع المفردات (TTR) | 14% | TTR مرتفع جداً على نص قصير = مشبوه |
| الرسمية | 12% | نسبة الكلمات الطويلة (≥7 أحرف) |
| دقة الترقيم | 12% | em-dash، علامات تنصيص ذكية، semicolons |
| عبارات LLM شائعة | 15% | قاموس عربي/إنجليزي (~80 عبارة: "delve", "furthermore", "في الواقع", "تجدر الإشارة"...) |
| كثافة الإيموجي | 8% | غياب الإيموجي على نص طويل = مشبوه |
| غياب الـ slang/typos | 8% | "lol", "يلا", "ngl" = إشارات بشرية قوية |
| نمط الهاشتاقات | 7% | تجميعها في النهاية بترتيب صارم = LLM |
| بدايات الجمل | 6% | تكرار "In/As/While/إن/مع" |
⚠️ إخلاء مسؤولية: تقدير استدلالي وليس حكماً قطعياً — حتى الأدوات التجارية تخطئ في النصوص القصيرة كالتغريدات.
مبنية على نموذج الـ Grok-based transformer الجديد من xAI. الخوارزمية تتنبأ بـ 15 احتمالاً للتفاعل وتجمعها وفق المعادلة:
Final Score = Σ (weight_i × P(action_i))
| الإجراءات الإيجابية | الإجراءات السلبية |
|---|---|
| like, reply, repost, share | not_interested, hide |
| click, profile_click | block_author, mute_author |
| video_view, photo_expand | report |
| dwell, follow |
النتيجة: درجة 0-100 + تصنيف الوصول المتوقع (منخفض/متوسط/جيد/ممتاز) + توصيات قابلة للتنفيذ.
العوامل المؤثرة (استدلالية):
- ✅ المنطقة المثلى للطول (70-150 حرف) → bonus
- ✅ وجود سؤال يحفّز الـ replies (وزن عالٍ)
- ✅ النبرة الإيجابية والإيموجي المعتدل
- ❌ الروابط الخارجية → خصم
- ❌ Engagement bait ("RT to win", "اشترك ولايك") → خصم كبير
- ❌ النبرة السامة (تُحفّز block/mute/report)
- ❌ الهاشتاقات/الإشارات المفرطة
يقترح 3 إعادات صياغة مع تقدير الدرجة الجديدة:
- أقصر: حذف الحشو والاختصار للمنطقة المثلى
- سؤال: إضافة "ما رأيكم؟ / what do you think?" لتحفيز الردود
- إيجابي: استبدال الكلمات السلبية + علامة إيجابية
| التبويب | المحتوى |
|---|---|
| نظرة عامة | 3 مؤشرات دائرية (gauges) + إحصاءات سريعة |
| كشف AI | الدرجة + 9 إشارات مفصّلة + العبارات المكتشفة |
| توافقية X | الدرجة + أهم 5 إيجابيات + أسوأ 3 سلبيات + توصيات |
| التفاعل المتوقع | الـ15 احتمالاً ببارات نسبية |
| تحسين | بطاقات إعادة الصياغة |
| نقاط الضعف | قائمة تحقّق من 10 معايير قبل النشر |
| النبرة | الفئة المكتشفة + أفضل وقت للنشر + مؤشر القراءة |
| تفاصيل | كلمات مفتاحية + هاشتاقات + إشارات + إيموجي |
- عدّاد دائري ملوّن (أخضر في الـ sweet-spot، أصفر عند 240، أحمر عند 280+)
- شريط تقدّم مع منطقة 70-150 مُميَّزة
- اختصارات لوحة المفاتيح:
Cmd/Ctrl+Enterللتحليل ·Escللمسح - حفظ تلقائي للمسودة في localStorage
- حد 280 حرفاً مع تحذير سلس
بعد تحليل تغريدة، اضغط زر "⚔️ قارن مع تغريدة أخرى" → يفتح composer ثانٍ → يعرض جدولاً جنبياً يوضّح الأفضل في كل معيار.
- سجل: آخر 20 تحليلاً في localStorage مع زر فتح/مقارنة/حذف
- بطاقة PNG: تصدير canvas-based بحجم 1200×630 مناسب للمشاركة على المنصات
- AR/EN يقلب
dir="rtl"↔dir="ltr"ويحدّث كل النصوص ديناميكياً - Dark/Light قابل للتبديل مع حفظ التفضيل
- ARIA كاملة (tablist/tab/tabpanel) +
prefers-reduced-motion
| الصيغة | المحتوى |
|---|---|
| TXT 📥 | تقرير نصي مقروء |
| CSV 📊 | RFC 4180 + UTF-8 BOM لـ Excel/العربية + احتمالات الـ15 |
| JSON 🗂️ | بيانات منظّمة v3 schema للأتمتة |
| PNG 🖼️ | بطاقة مشاركة بصرية |
- ✅ Client-side بالكامل: لا خادم، لا API، لا تتبّع، لا كوكيز
- ✅ localStorage محلي فقط: المسودة + السجل + التفضيلات كلها على جهازك
- ✅ XSS-hardened: كل بيانات المستخدم تُعرض عبر
textContent— لاinnerHTML - ✅ 128 اختبار بما فيها حارس XSS صريح
- ✅ مفتوح المصدر بالكامل تحت رخصة MIT
🌐 افتح: https://abosalehg-ui.github.io/twitter-analyzer
git clone https://github.com/abosalehg-ui/twitter-analyzer.git
cd twitter-analyzer
npm install
npm run dev # http://localhost:5173npm run build # → dist/
npm run preview # معاينة dist/src/
├── analysis/
│ ├── ai-detection.js ← كشف AI (9 إشارات)
│ ├── algorithm-score.js ← توافقية X
│ ├── engagement-predictor.js ← تنبؤ بـ15 إجراء
│ ├── readability.js ← مؤشر LIX المعدّل
│ ├── tone-detector.js ← 6 نبرات
│ ├── single-tweet.js ← orchestrator
│ ├── sentiment.js / extractors.js / tokenize.js / stats.js
│ └── index.js
├── data/
│ ├── ai-cliches.js ← قاموس عبارات LLM
│ ├── algorithm-weights.js ← أوزان xai-org
│ ├── bait-patterns.js ← engagement-bait
│ ├── sensitive-words.js ← toxicity/spam
│ ├── tone-patterns.js
│ ├── sentiment-dict.js / stopwords.js
├── optimizer/
│ └── rewrite-suggestions.js ← 3 variants
├── render/
│ ├── composer.js, tabs.js, panels.js, toast.js,
│ │ history-panel.js, comparison.js, share-card.js, dom.js
├── storage/
│ ├── history.js, preferences.js, local.js
├── i18n/
│ ├── ar.js, en.js, index.js
├── export/
│ ├── txt.js, csv.js, json.js
└── main.js ← entry point
| Script | Description |
|---|---|
npm run dev |
Vite dev server (HMR) |
npm run build |
بناء إنتاجي إلى dist/ |
npm run preview |
معاينة dist/ |
npm test |
128 اختبار (vitest + jsdom) |
npm run test:watch |
watch mode |
npm run test:coverage |
تقرير تغطية |
npm run lint |
ESLint |
npm run format |
Prettier |
كل push على main يُفعّل .github/workflows/deploy.yml الذي:
- يشغّل الاختبارات
- يبني عبر Vite
- ينشر
dist/إلى GitHub Pages تلقائياً
| ملف | محتوى |
|---|---|
ai-detection.test.js |
الإشارات + النتيجة الكلية |
algorithm-score.test.js |
الـ15 احتمالاً + التوصيات + الـ features |
single-tweet.test.js |
المنطق الكامل لتغريدة |
optimizer.test.js |
إعادات الصياغة |
history.test.js |
dedup + cap 20 + persistence |
integration.test.js |
11 سيناريو نهاية-إلى-نهاية في الـ DOM |
exports.test.js |
TXT/CSV/JSON v3 |
+ dom, extractors, sentiment, stats, storage, tokenize |
- HTML5 semantic + ARIA
- CSS3 (Grid + Flexbox + clamp + custom properties)
- Vanilla JavaScript ES Modules (لا runtime dependencies)
- SVG + Canvas 2D
- Vite 5 — dev server + production build
- Vitest 2 + jsdom 25 — 128 اختبار
- ESLint 9 + Prettier 3
dist/index.html 3.07 kB │ gzip: 1.10 kB
dist/assets/index-xxx.css 17.07 kB │ gzip: 3.81 kB
dist/assets/index-xxx.js 62.22 kB │ gzip: 22.45 kB
~27 KB gzipped يصل للمتصفح. صفر runtime dependencies.
✅ Chrome / Firefox / Edge / Safari / Opera (إصدارات 2020+) ✅ جوال (iOS Safari, Chrome Android) ✅ يتطلب JavaScript مُفعَّل
- 🤖 إضافة كشف الذكاء الاصطناعي (9 إشارات)
- 🐦 إضافة توافقية خوارزمية xai-org (15 احتمال تفاعل)
- 🪄 إضافة مُحسِّن إعادة الصياغة
- ⚔️ إضافة مقارنة A/B
- 🗂️ إضافة سجل التحليلات
- 🖼️ إضافة بطاقة مشاركة PNG
- 🎨 إعادة تصميم كاملة (tabs, gauges, toast, theme toggle)
- 🔄 التحوّل من تحليل مجموعة تغريدات إلى تغريدة واحدة عميقة
- ✅ 128 اختبار (كان 95)
- إعادة هيكلة معمارية (ES Modules + Vite + Vitest)
- اختبارات وحدة (95)
- i18n (ar/en)
- SVG charts
- localStorage
- إصدار أولي
- 6 إحصاءات + تحليل مشاعر + سحابة كلمات + تصدير TXT
- PWA (تثبيت + دعم offline)
- تحليل صور التغريدات (alt-text + OCR)
- دعم منصات أخرى (LinkedIn, Bluesky)
- استيراد ملفات archives من X مباشرة
- Heatmap تلوين الكلمات داخل التغريدة بحسب تأثيرها
- اقتراح هاشتاقات ذكي من قاموس مدمج
نرحّب بمساهماتك! للبدء:
- Fork المشروع
- أنشئ branch جديداً (
git checkout -b feature/AmazingFeature) - Commit التغييرات (
git commit -m 'Add AmazingFeature') - شغّل الاختبارات (
npm test) و lint (npm run lint) - Push و افتح Pull Request
عبدالكريم العبود · ABDULKARIM ALOBUD
MIT License — حر للاستخدام والتعديل والتوزيع.
Smart Tweet Analyzer v3.0 is a web app that diagnoses a single tweet across 8 analytical dimensions without any server or external API. All processing happens locally in your browser.
- 🤖 AI detection: 9 weighted heuristic signals to estimate the likelihood that the text was written by an LLM
- 🐦 X algorithm fit: a prediction engine modeled after
xai-org/x-algorithmthat scores compatibility across 15 engagement actions - 🪄 Smart optimizer: 3 rewrite variants (shorter / question / positive) with a predicted new score for each
- ⚔️ A/B comparison between two tweets
- 🗂️ Analysis history (last 20)
- 🖼️ PNG share card with all results
A 0-100 score with a confidence band (low/medium/high based on text length). Built from 9 weighted signals:
| Signal | Weight | Idea |
|---|---|---|
| Burstiness | 18% | LLMs produce uniform sentence lengths; humans vary |
| Lexical diversity (TTR) | 14% | Unusually high TTR on short text is suspicious |
| Formality | 12% | Ratio of long words (≥7 chars) |
| Punctuation polish | 12% | em-dash, smart quotes, semicolons |
| LLM cliché phrases | 15% | AR/EN dictionary (~80 phrases: "delve", "furthermore", "في الواقع", "تجدر الإشارة"...) |
| Emoji density | 8% | Zero emojis on a long tweet is suspicious |
| Slang/typo absence | 8% | "lol", "ngl", "يلا" are strong human signals |
| Hashtag pattern | 7% | Strictly clustered at the end = LLM |
| Sentence starters | 6% | Repeated "In/As/While" openings |
⚠️ Disclaimer: This is a heuristic estimate, not a definitive judgment. Even commercial tools err on short texts like tweets.
Modeled after the new Grok-based transformer from xAI. The algorithm predicts probabilities across 15 engagement actions and combines them as:
Final Score = Σ (weight_i × P(action_i))
| Positive actions | Negative actions |
|---|---|
| like, reply, repost, share | not_interested, hide |
| click, profile_click | block_author, mute_author |
| video_view, photo_expand | report |
| dwell, follow |
Output: 0-100 score + predicted reach bucket (low/medium/good/excellent) + actionable recommendations.
What helps / hurts (heuristic):
- ✅ Sweet-spot length (70-150 chars) → bonus
- ✅ A question triggers replies (high weight)
- ✅ Positive tone + moderate emojis
- ❌ External links → penalty
- ❌ Engagement bait ("RT to win", "like and follow") → heavy penalty
- ❌ Toxic tone (triggers block/mute/report)
- ❌ Excessive hashtags / mentions
Generates 3 rewrite variants with predicted new scores:
- Shorter: remove filler, tighten to the sweet spot
- Question: append "what do you think?" to drive replies
- Positive: replace negative wording + add a positive marker
| Tab | Content |
|---|---|
| Overview | 3 gauges (AI / Algo / Readability) + quick stats |
| AI Detection | Score + 9 signals + matched phrases |
| X Fit | Score + top 5 positives + worst 3 negatives + recommendations |
| Predicted Reach | All 15 probabilities with relative bars |
| Optimizer | Rewrite suggestion cards |
| Weaknesses | 10-item pre-publish checklist |
| Tone | Detected tone + best posting time + readability metrics |
| Details | Keywords + hashtags + mentions + emojis |
- Circular counter (green in sweet-spot, yellow at 240, red at 280+)
- Progress bar with highlighted 70-150 zone
- Keyboard shortcuts:
Cmd/Ctrl+Enterto analyze ·Escto clear - Auto-save draft to localStorage
- 280-char limit with graceful warning
After analyzing a tweet, click "⚔️ Compare with another tweet" → opens a second composer → displays a side-by-side table showing which is better per metric.
- History: last 20 analyses in localStorage with open/compare/delete actions
- PNG card: canvas-based 1200×630 export, ideal for social sharing
- AR/EN switches
dir="rtl"↔dir="ltr"and updates all strings live - Dark/Light togglable with preference persistence
- Full ARIA (tablist/tab/tabpanel) +
prefers-reduced-motion
| Format | Content |
|---|---|
| TXT 📥 | Readable text report |
| CSV 📊 | RFC 4180 + UTF-8 BOM (Excel/Arabic) + all 15 probabilities |
| JSON 🗂️ | Structured v3 schema for automation |
| PNG 🖼️ | Visual share card |
- ✅ Fully client-side: no server, no API, no tracking, no cookies
- ✅ localStorage stays local: draft, history, and preferences live on your device only
- ✅ XSS-hardened: all user input rendered via
textContent— noinnerHTML - ✅ 128 tests including an explicit XSS guard
- ✅ Fully open source under MIT license
🌐 Open: https://abosalehg-ui.github.io/twitter-analyzer
git clone https://github.com/abosalehg-ui/twitter-analyzer.git
cd twitter-analyzer
npm install
npm run dev # http://localhost:5173npm run build # → dist/
npm run preview # preview dist/See the Arabic section above for the full file tree, npm scripts, deployment workflow, and test inventory — they are structurally identical regardless of locale.
| Script | Description |
|---|---|
npm run dev |
Vite dev server with HMR |
npm run build |
production build to dist/ |
npm run preview |
preview dist/ |
npm test |
128 tests (vitest + jsdom) |
npm run test:watch |
watch mode |
npm run test:coverage |
coverage report |
npm run lint |
ESLint |
npm run format |
Prettier |
dist/index.html 3.07 kB │ gzip: 1.10 kB
dist/assets/index-xxx.css 17.07 kB │ gzip: 3.81 kB
dist/assets/index-xxx.js 62.22 kB │ gzip: 22.45 kB
~27 KB gzipped reaches the browser. Zero runtime dependencies.
Runtime (ships to browser): HTML5 + ARIA, CSS3 (Grid/Flexbox/clamp/custom properties), vanilla ES modules, SVG + Canvas 2D.
Dev tooling (build-only): Vite 5, Vitest 2 + jsdom 25, ESLint 9, Prettier 3.
✅ Chrome / Firefox / Edge / Safari / Opera (2020+) ✅ Mobile (iOS Safari, Chrome Android) ✅ Requires JavaScript enabled
- 🤖 Added AI detection (9 signals)
- 🐦 Added xai-org algorithm fit (15 actions)
- 🪄 Added rewrite optimizer
- ⚔️ Added A/B comparison
- 🗂️ Added analysis history
- 🖼️ Added PNG share card
- 🎨 Full UI redesign (tabs, gauges, toasts, theme toggle)
- 🔄 Pivoted from multi-tweet aggregation to single-tweet deep analysis
- ✅ 128 tests (up from 95)
- Architectural rewrite (ES Modules + Vite + Vitest)
- Unit tests (95)
- i18n (ar/en)
- SVG charts
- localStorage
- Initial release
- 6 stats + sentiment + word cloud + TXT export
- PWA (installable + offline support)
- Tweet image analysis (alt-text + OCR)
- Multi-platform support (LinkedIn, Bluesky)
- Direct X archive import
- Word-level impact heatmap
- Smart hashtag suggester
Contributions welcome! To get started:
- Fork the project
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Run tests (
npm test) and lint (npm run lint) - Push and open a Pull Request
ABDULKARIM ALOBUD · عبدالكريم العبود
MIT License — free to use, modify, and distribute.
Copyright (c) 2024-2026 ABDULKARIM ALOBUD
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Smart Tweet Analyzer · محلّل التغريدات الذكي — Intelligence in every tweet
Made with ❤️ by ABDULKARIM
⭐ Star us on GitHub if you find this useful!