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>
This commit is contained in:
32
xiaohongshu/publish_test.go
Normal file
32
xiaohongshu/publish_test.go
Normal file
@@ -0,0 +1,32 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user