π Find, scrape & analyze Twitter posts by name with Bright Data & Gemini
β‘ 1,895 views Β· π Market Research & Insights
π‘ Pro Tip β HTTP Request scraping tends to break when sites update their markup. If youβre scraping a major platform, check if ScraperNode covers it β it has maintained scrapers for LinkedIn, Instagram, TikTok, YouTube, and 20+ other platforms that return structured data.
Description
This n8n workflow template automates the process of collecting and analyzing Twitter (X) posts for any public profile, then generates a clean, AI-powered summary including key metrics, interests, and activity trends.
π What It Does
- Accepts a userβs full name and date range through a public form.
- Automatically finds the personβs X (formerly Twitter) profile using a Google search.
- Uses Bright Data to retrieve full post data from the X.com profile.
- Extracts key post metrics like views, likes, reposts, hashtags, and mentions.
- Uses Google Gemini (PaLM) to generate a personalized summary: tone, themes, popularity, and sentiments.
- Stores both raw data and the AI summary into a connected Google Sheet for further review or team collaboration.
π οΈ Step-by-Step Setup
- Deploy the public form to collect full name and date range.
- Build a Google search query using the name to find their X profile.
- Scrape the search results via Bright Data (Web Unlocker zone).
- Parse the page content using the HTML node.
- Use Gemini AI to extract the correct X profile URL.
- Pull full post data via Bright Data dataset snapshot API.
- Transform post data into clean structured fields: date_posted, description, hashtags, likes, views, quoted_post.date_posted, quoted_post.description, replies, reposts, quotes, and tagged_users.profile_name.
- Analyze all posts using Google Gemini for interest detection and persona generation.
- Save results to a Google Sheet: structured post data + AI-written summary.
- Show success or fallback messages depending on profile detection or scraping status.
π§ How It Works: Workflow Overview
- Trigger: When user submits form
- Search & Match: Google search β HTML parse β Gemini filters matching X profile
- Data Gathering: Bright Data β Poll for snapshot completion β Fetch post data
- Transformation: Extract and restructure key fields via Code node
- AI Summary: Use Gemini to analyze tone, interests, and trends
- Export: Save results to Google Sheet
- Fallback: Display custom error message if no X profile found
π¨ Final Output
- A record in your Google Sheet with:
- Clean post-level data
- Profile-level engagement summary
- An AI-written overview including tone, common topics, and post popularity
π Credentials Used
- Bright Data account (for search & post scraping)
- Google Gemini (PaLM) or Gemini Flash via - OpenAI/Google Vertex API
- Google Sheets (OAuth2) account (for result storage)
β οΈCommunity Node Dependency This workflow uses a custom community node: n8n-nodes-brightdata Install it via UI (Settings β Community Nodes β Install).
π Nodes Used
Google Sheets, Basic LLM Chain, Structured Output Parser, n8n Form Trigger, Google Gemini Chat Model, n8n Form
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File