Complete guide to your Social Media Listening Tool
Part of Wosuol System · Version 3.0 · AI Powered by Google Gemini
Social Listener monitors your brand, name, or product across social media platforms. It automatically:
| Dashboard (index.php) | Visual interface to see all mentions, charts, stats, and AI replies |
| API (api.php) | Backend that handles data processing, AI sentiment analysis, and reply generation |
| Database (MySQL) | Stores all mentions, replies, and monitoring targets |
| n8n Workflow | Automation that scrapes social media every 30 minutes |
| Apify | Cloud scraping service that collects data from Facebook, Instagram, Google, etc. |
| Google Gemini AI | AI that classifies sentiment and generates professional reply suggestions (FREE) |
GET api.php?action=get_targetsPOST api.php?action=process_mention| Total Mentions | Total number of social media mentions collected. Shows today's count below. |
| Risk Alerts | Count of Negative + Offensive mentions. Red border and pulse animation when active. These need your attention first. |
| Pending Review | Mentions you haven't marked as "handled" yet. Your to-do list. |
| Handled | Mentions you've reviewed and marked as done. |
| View | Opens the original post on social media in a new tab |
| Handle | Marks the mention as reviewed/handled (updates instantly) |
| Reply | Opens the AI Reply modal with a generated professional reply you can copy |
| Delete | Permanently deletes this mention from the database |
| Refresh | Manually refresh stats (also auto-refreshes every 60 seconds) |
| Export | Downloads all visible mentions as a CSV file |
| Config | Open the monitoring target configuration |
| Guide | Opens this user guide |
| Theme | Toggle dark/light mode (saved in your browser) |
Use the filter dropdowns above the feed table to narrow down results:
The Clear All button (red, next to "Live Feed") deletes ALL mentions from the database. It requires double confirmation. Use this to reset your data and start fresh.
Targets tell the system what to search for. Click "Config" in the navbar to manage them.
| Type | What to Enter | What It Does |
|---|---|---|
| keyword | Any text: brand name, person name, product | Searches Google for mentions on Facebook, Instagram, X, TikTok, and LinkedIn |
| facebook_page | Full URL: https://facebook.com/pagename | Scrapes up to 50 recent posts and 100 comments from that page |
| instagram_account | Handle: @username | Scrapes up to 50 recent posts from that account |
| twitter_handle | Handle: @username | Future: will search Twitter/X mentions directly |
| url | Any website URL | Future: will monitor that URL for changes |
| Target Type | Posts Scraped | Comments Scraped | Google Pages |
|---|---|---|---|
| Facebook Page | 50 posts | 100 comments | - |
| Instagram Account | 50 posts | - | - |
| Keyword Search | Up to 150 results | - | 3 pages x 50 results |
| Sentiment | AI Reply Tone |
|---|---|
| Positive | Warm thanks, appreciation, encourages connection |
| Neutral | Friendly acknowledgment, offers help |
| Negative | Empathetic, acknowledges concern, invites private resolution via DM/email |
| Offensive | Calm, professional, states facts, avoids conflict |
The AI automatically replies in the same language as the original post. If someone posts in Arabic, the reply will be in Arabic. If in English, the reply will be in English.
Every mention is analyzed by Google Gemini AI (gemini-2.0-flash model) and classified into one of four categories:
The n8n workflow is the automation engine that runs every 30 minutes.
| # | Node | What It Does |
|---|---|---|
| 1 | Every 30 Minutes | Schedule trigger - starts the workflow automatically |
| 2 | Get Active Targets | Calls your API to get the list of keywords/pages to monitor |
| 3 | Prepare Apify Jobs | Converts each target into an Apify scraping job with the right parameters |
| 4 | Run Apify Scraper | Calls Apify's API to scrape Facebook/Instagram/Google for each target |
| 5 | Normalize Results | Converts different Apify output formats into a unified mention format |
| 6 | AI Sentiment + Save | Sends each mention to your PHP API, which calls Gemini AI for sentiment + reply, then saves to database |
apify~google-search-scraper - For keyword searches across Facebook, Instagram, X, TikTok, LinkedIn via Googleapify~facebook-posts-scraper - For scraping specific Facebook pages (posts + comments)apify~instagram-scraper - For scraping Instagram profiles (posts)n8n-workflow.jsonBase URL: https://social.wosuol.com/api.php
| Endpoint | Method | Description |
|---|---|---|
| ?action=stats | GET | Returns total, risk, pending counts + sentiment/platform breakdowns |
| ?action=get_targets | GET | Returns all active monitoring targets (n8n reads this) |
| ?action=mark_handled | POST | Mark a mention as handled. Body: id=123 |
| ?action=delete_mention | POST | Delete a single mention. Body: id=123 |
| ?action=delete_all_mentions | POST | Delete ALL mentions and reset auto-increment |
| ?action=generate_reply | POST | Generate/regenerate AI reply for a mention. Body: id=123 |
| ?action=add_target | POST | Add monitoring target. Body: target_type=keyword&target_value=test |
| ?action=delete_target | POST | Delete target. Body: id=5 |
| ?action=toggle_target | POST | Toggle target active/inactive. Body: id=5 |
X-Api-Key header)| Endpoint | Method | Description |
|---|---|---|
| ?action=process_mention | POST | Insert 1 mention + auto AI sentiment + auto AI reply. JSON body with platform, author_name, post_content, post_url |
| ?action=process_batch | POST | Insert multiple mentions at once. JSON array body. |
| ?action=test | GET | Test API connection - shows Gemini AI, database, and curl status |
curl -X POST \
-H "X-Api-Key: your-secret-key" \
-H "Content-Type: application/json" \
-d '{
"platform": "Facebook",
"author_name": "John Doe",
"post_content": "This product is amazing!",
"post_url": "https://facebook.com/post/123",
"keyword_matched": "brand name"
}' \
https://social.wosuol.com/api.php?action=process_mention
Response:
{"success": true, "id": 45, "sentiment": "Positive", "has_reply": true}
https://social.wosuol.com/api.php?action=test&api_key=your-secret-key
Response shows: Gemini status, API key status, model name, DB connection, curl availability.
api.php?action=test&api_key=your-keyGEMINI_API_KEY is set in config.phpdefine('GEMINI_API_KEY', 'AIzaSy...');Make sure actor names use tilde (~) not slash: apify~google-search-scraper not apify/google-search-scraper
api.php?action=statssuggested_reply column exists in your database. Run:ALTER TABLE social_mentions ADD COLUMN suggested_reply TEXT DEFAULT NULL AFTER keyword_matched;The API checks post_url for duplicates. If Apify returns posts without URLs, duplicates may occur. This is normal for Google search results.
Check config.php → DB_HOST, DB_NAME, DB_USER, DB_PASS. On Hostinger, the host is usually localhost.
| Setting | Description |
|---|---|
DB_HOST, DB_NAME, DB_USER, DB_PASS | MySQL database credentials (from Hostinger) |
GEMINI_API_KEY | Your Google Gemini API key (free from aistudio.google.com) |
GEMINI_MODEL | AI model to use. Default: gemini-2.0-flash (free, fast) |
APIFY_TOKEN | Your Apify API token (from console.apify.com) |
API_SECRET_KEY | Secret key for protected API endpoints. Used in n8n X-Api-Key header. |