SuperAPI AI Directory

weibo-realtime-search

General & other

View repository

Updated 10-16 04:41

About this skill

Weibo Post Search

📝 Introduction

A Weibo post search tool that calls the Redfox interface to search Weibo posts based on keywords, supporting filtering by search category and verification type.

✨ Features

Feature Module Capability Description Core Value
Keyword Search Search Weibo posts by keyword Precisely discover content in the target niche
Search Category Supports three categories: comprehensive sorting/hot sorting/realtime sorting Discover high-quality content by different dimensions
Verification Filtering Supports filtering by regular user/personal verification/organization verification Precisely filter high-quality bloggers
Smart Expansion Automatically generates 10 expanded terms when there are no results Break through search bottlenecks and discover related content
Paginated Browsing Supports browsing results across multiple pages Explore large numbers of search results page by page
Subscription Push Supports daily push by keyword Get the latest search results on a schedule

🔑 Authentication

Get API Key

Please go to Redfox Hub to get the API KEY

Configure API Key

Option 1: Using Qoder as an example, add REDFOX_API_KEY to ~/.openclaw/openclaw.json :

{ "env": { "REDFOX_API_KEY": "ak_xxxx..." } }

Option 2: Terminal configuration

export REDFOX_API_KEY="ak_xxxx..."

🔄 Workflow

Step 1: Understand the user's intent and extract keywords and filter parameters

⚠️ Core rule: Semantic understanding takes priority; prioritize extracting niche direction terms rather than generalized broad category terms

1. Extract keywords

  • Extract 2-6 character niche keywords from the user's description
  • If the user's intent is vague (such as "help me search Weibo"), proactively ask: "What direction or field of content would you like to search for?"
  • Do not guess on your own and call the script when the user has not provided keywords

2. Identify filter parameters(use default values when the user does not specify)

  • Search category(--search-type): default 1(comprehensive)
    • User mentions "hot", "viral", "trending", "hot search" → 60(hot sorting)
    • User mentions "latest", "realtime", "now" → 61(realtime sorting)
    • Search category not mentioned → 1(comprehensive sorting, default)
  • Page number(--page): default 1
    • User mentions "next page", "page 2" → corresponding page number
    • User mentions "previous page" → current page - 1
    • Page number not mentioned → 1(default)
  • Verification category(--ext-param): not passed by default
    • User mentions "organization verification", "blue V" → 3
    • User mentioned "personal verification", "yellow V" → 2
    • User mentioned "regular user", "individual" → 0
    • No verification category mentioned → do not pass (no filtering)

Step 2: Call the search script

python3 ~/.agents/skills/weibo-search/scripts/search_weibo.py "<关键词>" [--search-type 搜索类别] [--page 页码] [--ext-param 认证类别]

Parameter description:

Parameter Optional values Meaning
keyword Any string Search keyword
--search-type 1 / 60 / 61 Comprehensive sort / Popular sort / Real-time sort (default 1)
--page Positive integer Page number, starting from 1 (default 1)
--ext-param 0 / 2 / 3 Verification category: 0-Regular user 2-Personal verification 3-Organization verification (not passed by default)

The script outputs in JSON format:

Field Description
articles List of posts matching the keyword
search_type_label Text description of the search category for this search
ext_param_label Text description of the verification category for this search
page Current page number
has_next Whether there is a next page (true/false)

Fields for each post:

Field Description
title Post content (taken from API text field)
author Blogger name
like_count Number of likes
comment_count Number of comments
share_count Number of reposts (taken from API forwardNum field)
work_url Post link
publish_time Publish time
follower_count Number of followers

Step 3: Determine the result and display it

Case A: articles count > 0 (there are matching results)

A1. Inform the user of the query scope

📊 Keyword "XXX" found Nposts (search category: {search_type_label} | verification: {ext_param_label} | page {page}), the detailed data is as follows:

A2. Render a Markdown table (display all)

| #   | 博文内容           | 博主   | 点赞数 | 评论数 | 转发数 |
| --- | ------------------ | ------ | ------ | ------ | ------ |
| 1   | [博文内容](链接)   | 博主名 | 305.2w | 7.1w   | 51.0w  |

Number formatting rules:

  • < 10000: original number (e.g. 320)
  • ≥ 10000:x.xw format (e.g. 1.2w)

Title rules: [博文内容](work_url); if more than 30 characters, truncate and add ...; if the title is empty, display -

A3. Search category and verification filter prompt (immediately after the table, must be output every time)

🔧 The following search categories are supported; reply with the corresponding command to switch:

  • Comprehensive sort — Comprehensive post search
  • Popular sort — Search popular posts
  • Real-time sort — Search the latest published posts

📌 Current:{search_type_label}

🔧 The following verification filters are supported; reply with the corresponding command to filter:

  • No filtering — Do not restrict verification type
  • Regular user — Search only regular users
  • Personal verification — Search only personal verification (yellow V)
  • Organization verification — Search only organization verification (blue V)

📌 Current:{ext_param_label}

Example: "Search again by popular, personal verification"

A4. Pagination prompt (⚠️ immediately after A3, cannot be omitted, must be output every time)

  • If has_next is true:

📄 Currently page {page} page. Reply "next page" to continue viewing.

  • If has_next is false (the current page has fewer than 9 items or is empty, and it is already the last page):

📄 Current page {page} page, there is no more data.

⚠️ A1~A4 are all indispensable and must be completed consecutively in the same output round. After outputting A4, immediately follow with the Step 4 subscription prompt. If A4 is missing, it is considered an execution error and the output must be re-supplemented.

Case B: articles count = 0 (no matching results)

B1. Apology prompt + keyword expansion recommendations

😔 Sorry, no content directly related to "XXX" was found. You can try again with shorter or broader keywords (expansion word 1, expansion word 2, ... expansion word 10)

AI must generateexactly 10expansion words, 2~6 characters, separated by English commas, and no fewer than 10.

B2. Search category and authentication filter prompt (immediately after B1, must be output every time, same format as A3)

⚠️ B1~B2 must be completed consecutively in the same output round. After outputting B2, immediately follow with the Step 4 subscription prompt, without interruption.

Step 4: Subscription prompt

After all content has been displayed,do not wait, end the output immediately, and only append the subscription prompt at the end:

📩 Would you like to subscribe to the daily push for "XXX"? After subscribing, the latest blog posts will be automatically pushed every day at 09:00. Reply "confirm subscription" to create a scheduled task.

Step 5: Create scheduled task (executed when the user replies "confirm subscription")

Prioritize using the platform's built-in scheduled task capability; if unavailable, provide a general solution:

Platform built-in scheduled task (preferred):

  • Task name:微博搜索订阅 - <关键词>
  • Execution frequency: every day at 09:00 (cron:0 10 * * *)
  • Execution content: run the script and display/push the results to the current conversation in the format of Steps 3~4

General configuration solution:

# Linux/macOS crontab
0 10 * * * python3 ~/.agents/skills/weibo-search/scripts/search_weibo.py "<关键词>"

After successful creation, inform the user: "Successfully subscribed to Weibo blog post push for keyword "<keyword>". Every day at 09:00, the latest data will be automatically queried and you will be notified."