From 3d5c8219d46af1b2e5c666b179b5e4ef0270225f Mon Sep 17 00:00:00 2001 From: zlei9 Date: Sun, 29 Mar 2026 09:48:38 +0800 Subject: [PATCH] Initial commit with translated description --- SKILL.md | 84 +++++++++++++++++++++++++++++++++++++++++ _meta.json | 6 +++ baidu_scholar_search.sh | 32 ++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 SKILL.md create mode 100644 _meta.json create mode 100644 baidu_scholar_search.sh diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..f7af2c0 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,84 @@ +--- +name: baidu-scholar-search-skill +description: "百度学术搜索 - 搜索中英文学术文献(期刊、会议、论文等)。" +homepage: https://xueshu.baidu.com/ +metadata: { "openclaw": { "emoji": "🔬", "requires": { "bins": ["curl"] ,"env":["BAIDU_API_KEY"]},"primaryEnv":"BAIDU_API_KEY" } } +--- + +# Baidu Scholar Search Skill + +## Features +Search Chinese and English academic literature by keyword, including journal papers, conference papers, dissertations, etc. + +## LLM Usage Guide + +### Basic Usage +```bash +bash baidu_scholar_search.sh "keyword" +bash baidu_scholar_search.sh "keyword" page_number +bash baidu_scholar_search.sh "keyword" page_number include_abstract +``` + +### Parameter Description +| Parameter | Required | Default | Description | +|-----------|----------|---------|-------------| +| keyword | ✅ | - | Search term, e.g., "machine learning" or "cancer immunotherapy" | +| page_number | ❌ | 0 | Starts from 0, 0=first page, 1=second page | +| include_abstract | ❌ | false | true=return detailed abstract, false=return only title and basic info | + +### Default Behavior +- **No abstract returned** - Fast response, suitable for quickly browsing literature lists +- Start from page 1 + +### When to Return Abstract +- User explicitly requests "abstract", "include abstract", "detailed content" +- User says "I need to understand the paper content", "give me detailed explanation" + +### When NOT to Return Abstract +- User only says "search", "retrieve", "check" +- User says "see what's available", "help me find" +- No explicit request for abstract information + +## API Specification + +### Endpoint +`GET https://qianfan.baidubce.com/v2/tools/baidu_scholar/search` + +### Request Parameters +- `wd` - Search keyword (required) +- `pageNum` - Page number (optional, default 0) +- `enable_abstract` - Whether to return abstract (optional, default false) + +### Response Fields +- `title` - Paper title +- `abstract` - Abstract (only returned when enable_abstract=true) +- `keyword` - Keywords +- `paperId` - Paper ID +- `publishYear` - Publication year +- `url` - Baidu Scholar link + +## Examples + +### Quick Search (No Abstract) +```bash +bash baidu_scholar_search.sh "cancer immunotherapy" +# Returns title, year, keywords and other basic information +``` + +### Detailed Search (With Abstract) +```bash +bash baidu_scholar_search.sh "cancer immunotherapy" 0 true +# Returns detailed information including abstract +``` + +### Pagination Search +```bash +bash baidu_scholar_search.sh "machine learning" 1 +# Search page 2 (no abstract) +``` + +## Notes +- Need to set `BAIDU_API_KEY` environment variable +- Keywords must be wrapped in quotes +- Returning abstract significantly increases response time +- Both Chinese and English keywords are supported diff --git a/_meta.json b/_meta.json new file mode 100644 index 0000000..e54d6e3 --- /dev/null +++ b/_meta.json @@ -0,0 +1,6 @@ +{ + "ownerId": "kn7akgt520t01vgs2tzx7yk6m180kt26", + "slug": "baidu-scholar-search-skill", + "version": "1.1.0", + "publishedAt": 1770956108163 +} \ No newline at end of file diff --git a/baidu_scholar_search.sh b/baidu_scholar_search.sh new file mode 100644 index 0000000..e5a3a01 --- /dev/null +++ b/baidu_scholar_search.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Baidu Scholar Search Skill Implementation +# Usage: bash baidu_scholar_search.sh "keyword" [page_number] [include_abstract] +# Example: bash baidu_scholar_search.sh "肿瘤免疫" 0 true + +set -e + +# Check required environment variable +if [ -z "$BAIDU_API_KEY" ]; then + echo '{"error": "BAIDU_API_KEY environment variable not set"}' + exit 1 +fi + +# Get search keyword (required) +WD="$1" +if [ -z "$WD" ]; then + echo '{"error": "Missing search keyword parameter"}' + exit 1 +fi + +# Page number (default 0, i.e., first page) +pageNum="${2:-0}" + +# Include abstract (default false, not included) +enable_abstract="${3:-false}" + +# Send request +curl -s -X GET \ + -H "Authorization: Bearer $BAIDU_API_KEY" \ + -H "X-Appbuilder-From: openclaw" \ + "https://qianfan.baidubce.com/v2/tools/baidu_scholar/search?wd=$WD&pageNum=$pageNum&enable_abstract=$enable_abstract"