Files
xiaohongshu-mcp/xiaohongshu/publish_test.go
zy 7cd35ebb71 feat: implement xiaohongshu automation with MCP server
Complete implementation of xiaohongshu (Little Red Book) automation system:

### Core Features:
- **QR Code Login**: Automated login with cookie persistence
- **Content Publishing**: Post text, images with AI-powered descriptions
- **Browser Management**: Headless Chrome automation via go-rod
- **Cookie Persistence**: Session management for login state
- **MCP Server**: Model Context Protocol integration for Claude

### Technical Components:
- go-rod browser automation with stealth mode
- MCP server for Claude Code integration
- Cookie-based session management
- Robust error handling and logging
- Cross-platform compatibility

### API Endpoints:
- Login status checking and QR code authentication
- Content publishing with image upload support
- Navigation and page interaction utilities

This provides a complete foundation for xiaohongshu automation
with proper session management and MCP integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 13:09:00 +08:00

33 lines
700 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package xiaohongshu
import (
"context"
"testing"
"github.com/xpzouying/xiaohongshu-mcp/browser"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPublish(t *testing.T) {
t.Skip("SKIP: 测试发布")
_ = browser.Init(false)
defer browser.Close()
page := browser.NewPage()
defer page.Close()
action, err := NewPublishImageAction(page)
require.NoError(t, err)
err = action.Publish(context.Background(), PublishImageContent{
Title: "Claude移动端重大更新随时随地高效办公",
Content: "Claude移动端重大更新随时随地高效办公",
ImagePaths: []string{"1948784311265894447"},
})
assert.NoError(t, err)
}