Twitter Sentiment to Postgres and Slack
detail.loadingPreview
Fetches tweets, analyzes sentiment, stores in PostgreSQL, and notifies Slack on high-sentiment tweets.
🚀Ready to Deploy This Workflow?
About This Workflow
Overview
This workflow automates the process of fetching tweets related to a specific hashtag, analyzing their sentiment using Google Cloud Natural Language, storing the tweet text and sentiment scores in a PostgreSQL database, and sending notifications to Slack for tweets with a significant positive sentiment.
Key Features
- Fetches tweets using the Twitter API.
- Analyzes sentiment (score and magnitude) of tweets using Google Cloud Natural Language.
- Stores tweet text and sentiment data in a PostgreSQL database.
- Inserts tweet data into a MongoDB collection.
- Sends notifications to Slack for tweets exceeding a defined sentiment score threshold.
How To Use
- Configure Credentials: Set up credentials for Twitter, PostgreSQL, MongoDB, Google Cloud Natural Language, and Slack in n8n.
- Set Twitter Search: In the Twitter node, configure the
searchTextwith the desired hashtag (e.g.,=#OnThisDay). Adjust thelimitas needed. - Configure MongoDB Insert: In the MongoDB node, specify the
collection(e.g.,tweets) and thefieldsto insert. - Configure Google Cloud NLP: Ensure the
contentin the Google Cloud Natural Language node correctly references the tweet text from the MongoDB output (e.g.,={{$node["MongoDB"].json["text"]}}). - Configure Set Node: In the Set node, map the sentiment
scoreandmagnitudefrom the Google Cloud NLP output to new fields. Also, ensure thetextfield is populated with the original tweet text. - Configure Postgres Node: In the PostgreSQL node, specify the
table(e.g.,tweets) and thecolumnsto store (text, score, magnitude). ThereturnFieldsshould be set to=*. - Configure If Node: Set the condition in the If node to filter tweets based on sentiment score (e.g.,
={{$json["score"]}}>0.5). Adjust the threshold as necessary. - Configure Slack Node: In the Slack node, customize the
textto include the tweet's score, magnitude, and content. Set the targetchannel. - Error Handling: The workflow includes an error handler for robust execution.
Apps Used
Workflow JSON
{
"id": "a40a3b01-f3a8-4945-8ea2-88c771f3b574",
"name": "Twitter Sentiment to Postgres and Slack",
"nodes": 0,
"category": "Data Integration",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: a40a3b01-f3a8...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Verification Info
Related Workflows
Discover more workflows you might like
Retell Call Data Processing
Processes incoming call data from Retell webhooks and saves it to both Airtable and Google Sheets.
Streamline Data from n8n Form to Google Sheets, Airtable, and Email Notifications
Automate data collection from an n8n form, store it in Google Sheets and Airtable, and send email notifications.
Productboard to Snowflake Integration
Synchronize Productboard data (notes, companies, features) into Snowflake.
Community Contributed: Import CSV from URL to Google Sheets
Imports data from a CSV file hosted at a URL and uploads it to a Google Sheet.
Icypeas Real-time Search Results Listener
Listen to Icypeas search results in real-time and process them.
Community Contributed: Import CSV to PostgreSQL
Automate the import of CSV files into a PostgreSQL database.