apidojo-io/apidojo-skills

analyzing-twitter-sentiment-for-topic

Analyzes public sentiment on Twitter/X for any topic, brand, or event using apidojo's Tweet scrapers on Apify.

Zobacz źródło

Jak używać

  1. Skopiuj polecenie instalacji i sprawdź źródła przed instalacją we własnym środowisku agenta.
  2. W oryginale sprawdź wymagane narzędzia, dane dostępowe i obsługiwane środowiska.
  3. Opisz dane wejściowe i oczekiwany rezultat; porównaj wynik ze źródłami.
npx skills add https://github.com/apidojo-io/apidojo-skills --skill analyzing-twitter-sentiment-for-topic

Przed rozpoczęciem

  • Instalacja nie obejmuje subskrypcji modelu, limitu API ani uprawnień do plików.
  • Gwiazdki i instalacje pokazują aktywność, a nie niezależny test jakości lub bezpieczeństwa.
Oryginalny dokument Skill

Treść z repozytorium z zachowaniem nagłówków, przykładów, kodu, tabel, linków i obrazów.

Analyzing Twitter Sentiment for a Topic

Collects a sample of tweets about any topic or keyword and performs sentiment analysis across the dataset. Identifies dominant emotional tone, key themes driving positive/negative sentiment, and volume patterns over time.

Prerequisites

  • APIFY_TOKEN environment variable set
  • Optional: Apify MCP server installed

Inputs

ParameterTypeRequiredDefaultNotes
searchTermsarray✅[]Twitter advanced search queries (e.g. ["#AI lang:en", "from:NASA"])
sortstringOptionalTopSort order: Latest, Top, or Latest+Top
tweetLanguagestringOptional—ISO 639-1 language code (e.g. en)
maxItemsnumberOptionalUnlimitedMaximum tweets to return
onlyVerifiedUsersbooleanOptionalfalseOnly tweets from verified users
onlyTwitterBluebooleanOptionalfalseOnly Twitter Blue subscribers
onlyImagebooleanOptionalfalseOnly tweets with images
onlyVideobooleanOptionalfalseOnly tweets with videos
onlyQuotebooleanOptionalfalseOnly quote tweets
authorstringOptional—Filter to a specific author handle
inReplyTostringOptional—Tweets replying to a specific handle
mentioningstringOptional—Tweets mentioning a specific handle
geotaggedNearstringOptional—Tweets near a location
withinRadiusstringOptional—Radius around geotaggedNear
geocodestringOptional—Lat/lng + radius string
placeObjectIdstringOptional—Tweets tagged with a place
minimumRetweetsnumberOptional—Minimum retweet count
minimumFavoritesnumberOptional—Minimum like count
minimumRepliesnumberOptional—Minimum reply count
startstringOptional—Tweets after this date (YYYY-MM-DD)
endstringOptional—Tweets before this date (YYYY-MM-DD)
includeSearchTermsbooleanOptionalfalseAdd the matched search term to each tweet
customMapFunctionstringOptional—JavaScript function to transform each output object

Workflow

Progress:
- [ ] Step 1: Define topic and sentiment scope
- [ ] Step 2: Collect tweets via search
- [ ] Step 3: Classify sentiment per tweet
- [ ] Step 4: Identify themes per sentiment bucket
- [ ] Step 5: Deliver sentiment report

Step 1: Clarify Parameters

Ask the user for:

  • Topic, keyword, or brand to analyze
  • Date range (default: last 7 days — Twitter sentiment data decays fast)
  • Language (default: English)
  • Sample size (default: 500 tweets — sufficient for reliable distribution)
  • Exclude retweets? (default: yes — reduces duplicated opinion signals)
  • Comparison topic (optional — for side-by-side sentiment comparison)

Step 2: Collect Tweets

Recommended — run_actor.js (handles waiting, output, and file saving automatically):

bash
# Quick answer (prints table to chat)
node scripts/run_actor.js \
  --actor "apidojo~tweet-scraper" \
  --input '{"param": "value"}'

# Save as CSV
node scripts/run_actor.js \
  --actor "apidojo~tweet-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.csv --format csv

# Save as JSON
node scripts/run_actor.js \
  --actor "apidojo~tweet-scraper" \
  --input '{"param": "value"}' \
  --output YYYY-MM-DD_results.json --format json
APIFY_TOKEN must be set in environment or .env file.

If Apify MCP is available:

Tool: apify:run-actor
Actor: "apidojo~tweet-scraper"
Input:
{
  "searchTerms": ["[TOPIC_KEYWORD]"],
  "maxItems": 500,
  "tweetLanguage": "en",
  "since": "[YYYY-MM-DD]",
  "until": "[YYYY-MM-DD]"
}

REST API fallback:

bash
curl -X POST \
  "https://api.apify.com/v2/acts/apidojo~tweet-scraper/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "searchTerms": ["[TOPIC_KEYWORD]"],
    "maxItems": 500,
    "tweetLanguage": "en",
    "since": "[YYYY-MM-DD]"
  }'

Step 3: Classify Sentiment

For each tweet's text, classify as Positive, Negative, or Neutral using lexical signals:

Positive indicators: love, great, amazing, perfect, best, win, excited, congrats, excellent, recommend, beautiful, proud, happy, thank, awesome, incredible Negative indicators: hate, awful, worst, terrible, broken, scam, disappointed, angry, frustrated, disgusted, avoid, never again, shame, sad, fail, wrong, bad Strong negative amplifiers: "can't believe", "what a joke", "are you serious", "wtf", "this is ridiculous" Neutral default: Everything else

For ambiguous cases, use emoji signals:

  • 😍🥰❤️🙌👏✨🔥 → lean Positive
  • 😡🤬😤💀🗑️🤢👎 → lean Negative
  • 🤔😐🤷 → lean Neutral

Weight tweets by engagement: a tweet with 1,000 likes carries more signal than one with 0.

Step 4: Theme Extraction

For Negative tweets: identify the top 3-5 recurring nouns/themes. What are people upset about specifically? For Positive tweets: identify the top 3-5 recurring praise themes.

Look for proper nouns (people, places, products), specific events, or feature names that appear repeatedly.

Step 5: Format Report

Output Format

# Twitter Sentiment Analysis: "[TOPIC]"
Period: [DATE_RANGE] | Tweets analyzed: [N] | Date: [DATE]

## Overall Sentiment

████████████░░░░░░░░ Positive: [X%] ([N] tweets) ████░░░░░░░░░░░░░░░░ Negative: [X%] ([N] tweets) ██████████░░░░░░░░░░ Neutral: [X%] ([N] tweets)


Weighted by engagement:
- Positive sentiment accounts for [X%] of total likes/RTs
- Negative sentiment accounts for [X%] of total likes/RTs

**Overall verdict:** [Mostly Positive / Mixed / Mostly Negative / Polarized]

## Top Negative Themes
1. "[Theme]" — [N] tweets, [N] total likes
   Example: "@[handle]: [tweet excerpt]"
2. "[Theme]" — [N] tweets
3. "[Theme]" — [N] tweets

## Top Positive Themes
1. "[Theme]" — [N] tweets, [N] total likes
   Example: "@[handle]: [tweet excerpt]"
2. "[Theme]" — [N] tweets

## Most Engaged Tweets
🔴 Most-liked negative: @[handle] ([N] likes): "[excerpt]"
🟢 Most-liked positive: @[handle] ([N] likes): "[excerpt]"

## Volume Over Time
[Day 1]: [N] tweets | [Day 2]: [N] tweets | [Day 3]: [N] tweets

## Notable Spikes
[Date with highest volume] — [N] tweets | Likely cause: [describe if detectable from tweet context]

Troubleshooting

Sentiment feels inaccurate: Lexical analysis misses sarcasm. For high-stakes decisions, manually review the top 20 tweets per bucket. Topic too broad: Narrow the search term. "Apple" returns tech and food — use "Apple iPhone" instead. Very low tweet volume: Topic may not be actively discussed on Twitter right now. Expand date range.

Powiązane zadania

z tego samego repozytorium

Więcej Skills

Wszystkie Skills
apidojo-io
Społeczność

scraping-urban-dictionary-definitions

Extracts definitions, examples, and community votes from Urban Dictionary using apidojo's Urban Dictionary Scraper on Apify. Triggers when the user asks to: get Urban Dictionary definitions for a word or phrase, look up slang terms on Urban Dictionary, scrape definitions for internet slang or memes, export Urban Dictionary entries for a keyword, find how a term is defined by the internet community, collect crowd-sourced definitions for multiple words, or analyze slang usage and voting patterns.

instalacje
2
GitHub Stars
1
Aktualizacja
13 maj
apidojo-io
Społeczność

finding-speaking-opportunities-on-twitter

Finds speaking opportunities and event organizer contacts on Twitter using apidojo's Twitter scrapers. Triggers when the user asks to: find speaking opportunities on Twitter, discover conferences looking for speakers on X, find event organizers calling for speaker submissions, identify call-for-speakers announcements in an industry on Twitter, find podcast or summit hosts looking for guests, discover virtual event opportunities for thought leadership, or build a speaking opportunity pipeline fro

instalacje
2
GitHub Stars
1
Aktualizacja
13 maj
apidojo-io
Społeczność

extracting-google-paa-questions-for-seo

Extracts Google People Also Ask questions for SEO content planning using apidojo's Google Search scraper on Apify. Triggers when the user asks to: find People Also Ask questions on Google for SEO, extract PAA questions for keyword research, discover what questions Google shows for a topic, find long-tail SEO questions from Google, research FAQ content opportunities from Google SERP, build a list of questions to answer in blog content from Google, or extract Google autocomplete and PAA data for c

instalacje
1
GitHub Stars
1
Aktualizacja
13 maj
apidojo-io
Społeczność

scraping-youtube-channel-info

Extracts YouTube channel metadata, subscriber counts, video counts, and descriptions using apidojo's YouTube Channel Scraper on Apify. Triggers when the user asks to: get YouTube channel information, scrape YouTube channel stats, fetch subscriber count for a YouTube channel, export channel metadata in bulk, find YouTube channels by keyword, get channel descriptions and tags, check if a YouTube channel is verified, or research YouTube channels by niche. Returns channel name, subscriber count, vid

instalacje
1
GitHub Stars
1
Aktualizacja
13 maj