ScavioScavio
ProductoPreciosDocumentación
Iniciar sesionComenzar
  1. Inicio
  2. Flujos de trabajo
  3. Reddit Brand Alert Workflow
Flujo de trabajo

Reddit Brand Alert Workflow

Monitorear Reddit for menciones de marca cada 4 horas. Alert on negative sentiment o caracteristica solicitudes. Python implementacion con Scavio Reddit search API.

Comenzar gratisDocumentacion API

Resumen

Searches Reddit cada 4 horas for marca y producto menciones, classifies sentiment usando palabra clave senales, y alertas on negative publicaciones o caracteristica solicitud threads ese warrant un respuesta.

Desencadenador

Every 4 horas (cron: 0 */4 * * *)

Programación

Every 4 horas (cron: 0 */4 * * *)

Pasos del flujo de trabajo

1

Search Reddit for menciones de marca

POST to Scavio search API con plataforma: reddit y consulta '[nombre de marca] OR [producto nombre]'. Extraer publicacion titles, URLs, subreddit, y fragmentos.

2

Deduplicate contra visto publicaciones

Comparar publicacion URLs contra un seen_posts tabla. Procesar solo nuevo publicaciones no previously visto.

3

Clasificar sentiment y intent

Apply palabra clave classification: negative sentiment (broken, terrible, doesn't funciona, waste, refund, scam), caracteristica solicitud (please agregar, haria be great, wish it tenia, puede you agregar), positive (love, great, funciona perfectly, recommend).

4

Almacenar classified publicaciones

Insert post_url, titulo, subreddit, sentiment, intent, fragmento, y detected_at en brand_mentions tabla.

5

Alert on negative o feature-request publicaciones

For publicaciones classified as negative o feature_request, enviar Slack alerta con publicacion titulo, URL, subreddit, y classification.

6

Generar 4-hora resumen

Count nuevo menciones by sentiment class. Log resumen to un daily_summaries tabla for tendencia seguimiento.

Implementacion en Python

Python
import sqlite3
import requests
from datetime import datetime
import time

DB_PATH = "brand_mentions.db"
SCRAVIO_KEY = "YOUR_API_KEY"
BRAND_QUERY = "scavio OR scavio.com"
ALERT_WEBHOOK = "https://hooks.slack.com/services/YOUR/WEBHOOK"

NEGATIVE_KEYWORDS = ["broken", "terrible", "doesn't work", "does not work",
                      "waste", "refund", "scam", "useless", "garbage", "awful"]
FEATURE_KEYWORDS = ["please add", "would be great", "wish it had", "can you add",
                     "feature request", "would love", "should support"]
POSITIVE_KEYWORDS = ["love", "great", "works perfectly", "recommend",
                      "excellent", "fantastic", "best tool"]

def init_db():
    conn = sqlite3.connect(DB_PATH)
    conn.executescript("""
        CREATE TABLE IF NOT EXISTS brand_mentions (
            url TEXT PRIMARY KEY, title TEXT, subreddit TEXT,
            sentiment TEXT, intent TEXT, snippet TEXT, detected_at TEXT
        );
        CREATE TABLE IF NOT EXISTS daily_summaries (
            date TEXT, hour INTEGER, positive INTEGER, negative INTEGER, feature_request INTEGER, neutral INTEGER
        );
    """)
    conn.commit()
    return conn

def classify(text: str) -> tuple[str, str]:
    t = text.lower()
    sentiment = "neutral"
    intent = "mention"
    if any(k in t for k in NEGATIVE_KEYWORDS):
        sentiment = "negative"
    elif any(k in t for k in POSITIVE_KEYWORDS):
        sentiment = "positive"
    if any(k in t for k in FEATURE_KEYWORDS):
        intent = "feature_request"
    return sentiment, intent

def run():
    conn = init_db()
    now = datetime.utcnow().isoformat()
    resp = requests.post(
        "https://api.scavio.dev/api/v1/search",
        headers={"x-api-key": SCRAVIO_KEY},
        json={"query": BRAND_QUERY, "platform": "reddit", "num": 20}
    )
    resp.raise_for_status()
    results = resp.json().get("results", [])
    counts = {"positive": 0, "negative": 0, "feature_request": 0, "neutral": 0}
    for r in results:
        url = r.get("url", "")
        if not url:
            continue
        existing = conn.execute("SELECT 1 FROM brand_mentions WHERE url=?", (url,)).fetchone()
        if existing:
            continue
        title = r.get("title", "")
        snippet = r.get("snippet", "")
        combined = f"{title} {snippet}"
        sentiment, intent = classify(combined)
        subreddit = r.get("subreddit", r.get("source", ""))
        conn.execute("INSERT OR IGNORE INTO brand_mentions VALUES (?,?,?,?,?,?,?)",
                     (url, title, subreddit, sentiment, intent, snippet[:300], now))
        key = "feature_request" if intent == "feature_request" else sentiment
        counts[key] = counts.get(key, 0) + 1
        if sentiment == "negative" or intent == "feature_request":
            requests.post(ALERT_WEBHOOK, json={
                "text": f"Reddit alert [{sentiment}/{intent}] r/{subreddit}: {title} {url}"
            })
    conn.commit()
    print(f"Mentions: {counts}")

if __name__ == "__main__":
    run()

Implementacion en JavaScript

JavaScript
const Database = require('better-sqlite3');
const fetch = require('node-fetch');

const DB_PATH = 'brand_mentions.db';
const SCRAVIO_KEY = 'YOUR_API_KEY';
const BRAND_QUERY = 'scavio OR scavio.com';
const ALERT_WEBHOOK = 'https://hooks.slack.com/services/YOUR/WEBHOOK';
const NEGATIVE = ['broken','terrible','does not work','waste','refund','scam','useless'];
const FEATURE = ['please add','would be great','wish it had','feature request','would love'];
const POSITIVE = ['love','great','works perfectly','recommend','excellent'];

const db = new Database(DB_PATH);
db.exec(`
  CREATE TABLE IF NOT EXISTS brand_mentions (url TEXT PRIMARY KEY, title TEXT, subreddit TEXT, sentiment TEXT, intent TEXT, snippet TEXT, detected_at TEXT);
`);

function classify(text) {
  const t = text.toLowerCase();
  const sentiment = NEGATIVE.some(k => t.includes(k)) ? 'negative' : POSITIVE.some(k => t.includes(k)) ? 'positive' : 'neutral';
  const intent = FEATURE.some(k => t.includes(k)) ? 'feature_request' : 'mention';
  return { sentiment, intent };
}

async function run() {
  const now = new Date().toISOString();
  const res = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'x-api-key': SCRAVIO_KEY, 'Content-Type': 'application/json' },
    body: JSON.stringify({ query: BRAND_QUERY, platform: 'reddit', num: 20 })
  });
  const results = (await res.json()).results || [];
  for (const r of results) {
    if (!r.url || db.prepare('SELECT 1 FROM brand_mentions WHERE url=?').get(r.url)) continue;
    const { sentiment, intent } = classify(`${r.title} ${r.snippet}`);
    db.prepare('INSERT OR IGNORE INTO brand_mentions VALUES (?,?,?,?,?,?,?)').run(
      r.url, r.title, r.subreddit || '', sentiment, intent, (r.snippet || '').slice(0, 300), now
    );
    if (sentiment === 'negative' || intent === 'feature_request') {
      await fetch(ALERT_WEBHOOK, {
        method: 'POST', headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ text: `Reddit alert [${sentiment}/${intent}]: ${r.title} ${r.url}` })
      });
    }
  }
}

run().catch(console.error);

Plataformas utilizadas

Reddit

Comunidad, publicaciones y comentarios en hilos de cualquier subreddit

Preguntas frecuentes

Searches Reddit cada 4 horas for marca y producto menciones, classifies sentiment usando palabra clave senales, y alertas on negative publicaciones o caracteristica solicitud threads ese warrant un respuesta.

Este flujo de trabajo usa un every 4 horas (cron: 0 */4 * * *). Every 4 horas (cron: 0 */4 * * *).

Este flujo de trabajo usa las siguientes plataformas de Scavio: reddit. Cada plataforma se llama a traves del mismo endpoint de API unificado.

Si. El plan gratuito de Scavio incluye 50 creditos al registrarte sin tarjeta de credito. Es suficiente para probar y validar este flujo de trabajo antes de escalarlo.

Reddit Brand Alert Workflow

Monitorear Reddit for menciones de marca cada 4 horas. Alert on negative sentiment o caracteristica solicitudes. Python implementacion con Scavio Reddit search API.

Obtener tu clave APILeer la documentacion
ScavioScavio

API de busqueda en tiempo real para agentes de IA. Busca en todas las plataformas, no solo en Google.

Producto

  • Funciones
  • Precios
  • Panel
  • Afiliados

Desarrolladores

  • Documentacion
  • Referencia de API
  • Inicio rapido
  • Integracion MCP
  • Python SDK

Alternativas

  • Alternativa a Tavily
  • Alternativa a SerpAPI
  • Alternativa a Firecrawl
  • Alternativa a Exa

Herramientas

  • Formateador JSON
  • cURL a codigo
  • Contador de tokens
  • Todas las herramientas

© 2026 Scavio. Todos los derechos reservados.

Featured on TAAFT
Terminos de servicioPolitica de privacidad