Commit Graph

18 Commits

Author SHA1 Message Date
CooperGuo
5f412a6bc5 feat:获取用户主页功能 (#122)
增加读取用户的个人主页的信息
2025-09-20 22:20:58 +08:00
Journey
fec85b2b30 feat: 添加图片上传验证与超时处理功能 (#115)
(cherry picked from commit 651b1578ae341f0a5cbb1447d483cc8954f7e5bc)

Co-authored-by: chengchongzhen <15939054361@163.com>
2025-09-20 00:16:07 +08:00
zy
b86d3626f1 Revert "Revert PR #105" - 恢复 publish.go 功能 (#109)
* Reapply "Merge pull request #105 from chengazhen/main" (#107)

This reverts commit 81ff26d6a7.

* feature: 获取有效的元素
2025-09-18 22:25:36 +08:00
zy
81ff26d6a7 Revert "Merge pull request #105 from chengazhen/main" (#107)
This reverts commit aaf5fdedf1.
2025-09-18 22:12:24 +08:00
Journey
aaf5fdedf1 Merge pull request #105 from chengazhen/main
feat: 添加蜜罐元素检测与过滤功能
2025-09-18 22:08:26 +08:00
zy
60e48fec0c types: del user xsecToken (#100)
删除用户中的 xsecToken,该字段暂时没有用,有的大模型容易识别错误,把user的token当做 note 的token用。

CLOSED #96
2025-09-17 22:26:06 +08:00
zy
3143576cc0 publish tags by arrow down (#80)
使用 arrow down 吧,arrow-right 有时候不能移动到最结尾
2025-09-16 02:12:21 +08:00
zy
90169ec894 refactor: 优化小红书标签输入逻辑 (#71)
* refactor: 优化小红书标签输入逻辑

- 调整 inputTag 函数以减少延迟时间
- 增加标签联想下拉框的等待时间
- 更新 MustInput 和 MustKeyActions 方法的调用顺序
- 添加错误处理和日志记录以增强稳定性

* update headless_browser version

* downgrade fetchup version

* update publish
2025-09-14 21:47:55 +08:00
zy
47aba20735 feat: 添加小红书标签功能支持 (#65)
* feat: 实现小红书标签输入和自动关联功能

- 在 PublishImageContent 结构体中添加 Tags 字段
- 实现 inputTags 函数处理多个标签输入
- 实现 inputTag 函数自动点击标签联想下拉框
- 通过 #creator-editor-topic-container 选择器定位标签下拉框
- 自动点击第一个 .item 元素完成标签关联
- 添加错误处理和日志记录

* feat: 为 MCP 和 HTTP API 添加标签(tags)支持

- 在 PublishRequest 结构体中添加 Tags 字段
- 更新 MCP handler 处理标签参数
- 更新 MCP 工具定义,添加 tags 参数说明
- HTTP API 自动支持 tags 字段(通过 PublishRequest)
- 保持向后兼容,tags 为可选参数
2025-09-14 15:06:23 +08:00
zy
f21183fa48 update wait for list feed and get feed details (#52)
更新一下 list-feed,get-feed-detail 行为的等待,
这里可能是 windows 的问题所在
2025-09-10 00:30:31 +08:00
zy
cd28e4064e feat: 添加小红书Feed评论功能 (#50)
实现通过HTTP GIN API和MCP API发表评论到小红书Feed的功能:
- 新增POST /api/v1/feeds/comment端点
- 新增post_comment_to_feed MCP工具
- 添加PostCommentRequest和PostCommentResponse类型
- 实现PostCommentToFeed服务方法
- 新增CommentFeedAction用于浏览器自动化操作

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 23:13:05 +08:00
zy
27575689a6 feat: enhance feed detail functionality with MCP interface improvements (#45)
* feat: add feed detail page functionality with gin and MCP interfaces

Add comprehensive Feed detail page support:
- Create new FeedDetailAction in xiaohongshu/feed_detail.go
- Add HTTP API endpoint POST /api/v1/feeds/detail
- Add MCP tool 'get_feed_detail' for MCP protocol support
- Support feed_id and xsec_token parameters (both required)
- Raw __INITIAL_STATE__ JSON data saved to feed_detail.json
- Return structured data for both HTTP and MCP interfaces

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

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: enhance feed detail functionality with MCP interface improvements

- Add comprehensive feed detail page support with proper data extraction
- Create dedicated feed_detail.go file for FeedDetailAction
- Optimize Go struct definitions based on actual JSON data analysis
- Remove unnecessary fields from FeedDetail, DetailImageInfo, CommentList, and Comment structs
- Update MCP interface description to reflect comment retrieval capability
- Support both HTTP REST API and MCP protocol interfaces
- Implement proper Vue 3 reactive data extraction from window.__INITIAL_STATE__
- Include feed content, user info, interaction data, and comment lists

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: restore JSON file writing for testing and improve code structure

- Restore feed_detail.json file writing for testing purposes
- Improve error handling by separating marshal and unmarshal steps
- Keep the original data extraction logic for complex Vue reactive data structure

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

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: simplify JSON unmarshaling using struct instead of map[string]any

- Replace complex map[string]any extraction with direct struct unmarshaling
- Define inline struct matching the actual JSON response structure
- Remove unnecessary extractFeedDetailData and extractNestedValue methods
- Significantly reduce code complexity and improve readability

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

Co-Authored-By: Claude <noreply@anthropic.com>

* docs: improve MCP interface descriptions for better usability

- Enhance get_feed_detail parameter descriptions with clear source information
- Clarify publish_content images parameter supports both local paths and URLs
- Improve search_feeds description to specify supported search types
- Keep descriptions concise and practical without over-complication

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix: revert search_feeds keyword description to keep it simple

- Remove unnecessary details from keyword description
- Keep interface descriptions concise and clear

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

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 00:55:24 +08:00
zy
aa09687751 feat: 添加搜索功能 (#16)
- 新增 SearchFeeds 服务方法,支持关键词搜索小红书内容
- 添加 search_feeds MCP 工具,提供搜索接口
- 新增 /api/v1/feeds/search API 端点
- 实现搜索页面的浏览器自动化操作
- 优化 MCP 协议支持,处理 notifications/initialized 和 notifications/cancelled 通知
- 更新文档,添加搜索功能说明和使用示例
- 重构类型定义,优化数据结构

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 23:35:22 +08:00
zy
0e4450b12c refactor: 改进浏览器实例管理,按需创建浏览器实例 (#12)
- 移除全局浏览器单例,改为按需创建浏览器实例
- 添加 configs/browser.go 用于管理无头模式配置
- 更新 service.go 中所有方法,每次调用时创建新的浏览器实例
- 更新测试文件,使用新的浏览器管理方式
- 确保每个浏览器实例使用后正确关闭,避免资源泄漏

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

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-17 15:30:16 +08:00
zy
86224dcaa3 update find content element (#10)
- Updated the getContentElement function to utilize the Race method for improved efficiency in finding content elements.
- Added error handling for cases where no elements are found, ensuring better logging and debugging capabilities.
2025-08-13 02:34:50 +08:00
zy
108da414fd feat: 实现获取小红书首页 Feed 列表功能
- 添加 FeedsListAction 用于获取页面 window.__INITIAL_STATE__ 数据
- 定义完整的 Feed 数据结构,包含笔记、视频、用户信息等
- 实现 GetFeedsList 方法解析并返回 Feed 列表
- 添加单元测试验证数据获取和 JSON 序列化

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 01:11:27 +08:00
zy
e156592d34 增加上传图片后,更多的等待时间 (#5)
FIX: #1
2025-08-11 23:15:50 +08:00
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