@luoyi-dsh/instagram-scroll 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,158 +1,202 @@
1
- # DSH Instagram 滾動瀏覽與探索插件 (`@luoyi-dsh/instagram-scroll`)
2
-
3
- ![Banner](assets/banner.png)
4
-
5
- > **DeepSeek Harness (DSH)** 專屬的 Instagram 動態探索、智慧推坑與日報生成外掛。
6
- > 具備核心能力:**定時或手動替主人刷一輪 Instagram 首頁動態與主題標籤、逐條閱讀內文評估主人興趣、自動點讚與留言推坑,並自動彙整生成每日 Markdown 探索日報**。
7
-
8
- ---
9
-
10
- ## 🌟 核心特性
11
-
12
- 1. **自動動態探索巡查 (Scroll Duty)**:
13
- - 定期輪詢首頁動態牆 (Timeline Feed) 與指定主題標籤 (Hashtags)。
14
- - 逐則貼文抓取標題、作者、標籤與完整內文。
15
- 2. **LLM 價值評估與推坑 (AI Recommendation)**:
16
- - 由大語言模型依據主人的興趣 Prompt 深度分析貼文內容與價值評分。
17
- - 若達標(預設 > 75 分),自動在貼文下點讚並留言 `@目標用戶` 附上真誠自然的推薦語。
18
- 3. **每日探索日報 (Daily Markdown Report)**:
19
- - 自動將今日瀏覽之所有精選貼文、摘要與推薦紀錄整理為 Markdown 日報。
20
- - 儲存於 `data/reports/YYYY-MM-DD.md`,可隨時在 Web 面板查看與回溯。
21
- 4. **狀態帳本與嚴格去重控制**:
22
- - `data/scroll_ledger.json` 記錄已看貼文 PK 與今日推坑次數,避免重複推坑或重複閱讀,並防止觸發風控。
23
- 5. **DSH Web 瀏覽器端介面 (`client.js`)**:
24
- - 提供直觀動態牆瀑布流預覽、即時手動觸發刷動態按鈕、日報閱讀器與自訂設定面板。
25
-
26
- ---
27
-
28
- ## 📦 安裝方式
29
-
30
- 使用 DSH CLI 安裝插件:
31
-
32
- ```bash
33
- dsh plugin --profile web add @luoyi-dsh/instagram-scroll
34
- ```
35
-
36
- 或透過 npm 安裝:
37
-
38
- ```bash
39
- npm install @luoyi-dsh/instagram-scroll
40
- ```
41
-
42
- ---
43
-
44
- ## 🛠️ 提供之 DSH Tools
45
-
46
- | 工具名稱 | 說明 | 參數 |
47
- | :--- | :--- | :--- |
48
- | **`ig_run_scroll_duty_now`** | 立即手動替主人刷一輪 Instagram 動態與探索,讀取貼文進行評估、點讚與留言推坑 | 無 |
49
- | **`ig_scroll_feed`** | 滾動讀取 Instagram 時間軸最新動態貼文(含作者、讚數、內文摘要) | `limit` (number,預設 15,最大 50) |
50
- | **`ig_explore_topics`** | 依照指定主題或探索標籤滾動閱讀熱門貼文 | `tag` (string,必填), `limit` (number,預設 15) |
51
- | **`ig_like_feed_post`** | 在滾動瀏覽過程中對感興趣的 Instagram 貼文按讚 | `media_pk` (string,必填) |
52
-
53
- ---
54
-
55
- ## 💻 使用範例
56
-
57
- ### 1. DSH AI 自然語言直接調用
58
-
59
- 在 DSH 對話中,主模型可直接以自然語言執行滾動探索或瀏覽:
60
-
61
- ```text
62
- 💬 範例 1:執行一輪完整的動態探索與推坑
63
- 「請立刻替我刷一輪 Instagram 動態牆,看看有沒有適合我的技術新貼文並推薦給我」
64
- -> AI 將調用:ig_run_scroll_duty_now()
65
-
66
- 💬 範例 2:滾動瀏覽首頁動態貼文
67
- 「幫我刷最新 10 則 Instagram 動態」
68
- -> AI 將調用:ig_scroll_feed(limit=10)
69
-
70
- 💬 範例 3:探索特定主題標籤
71
- 「探索 Instagram 上 #deepseek 標籤的熱門貼文」
72
- -> AI 將調用:ig_explore_topics(tag="deepseek", limit=15)
73
- ```
74
-
75
- ---
76
-
77
- ### 2. 透過 HTTP REST API 調用 (DSH Web 路由)
78
-
79
- > 💡 **提示**:DSH Web 預設埠號為 **3080**。插件已註冊官方 REST API(前綴 `/api/instagram/scroll`):
80
-
81
- #### 1. 手動觸發滾動一輪 (`POST /api/instagram/scroll/run`)
82
- ```bash
83
- curl -X POST http://127.0.0.1:3080/api/instagram/scroll/run
84
- ```
85
-
86
- #### 2. 獲取當前滾動狀態與今日統計 (`GET /api/instagram/scroll/status`)
87
- ```bash
88
- curl http://127.0.0.1:3080/api/instagram/scroll/status
89
- ```
90
-
91
- #### 3. 讀取今日探索日報內容 (`GET /api/instagram/scroll/report`)
92
- ```bash
93
- curl http://127.0.0.1:3080/api/instagram/scroll/report
94
- ```
95
-
96
- #### 4. 讀取與更新設定 (`GET / POST /api/instagram/scroll/config`)
97
- ```bash
98
- # 取得設定
99
- curl http://127.0.0.1:3080/api/instagram/scroll/config
100
-
101
- # 更新設定
102
- curl -X POST http://127.0.0.1:3080/api/instagram/scroll/config \
103
- -H "Content-Type: application/json" \
104
- -d '{"masterUsername":"your_username","minScore":80}'
105
- ```
106
-
107
- ---
108
-
109
- ## ⚙️ 設定參數說明 (Settings)
110
-
111
- 可於 DSH 設定面板或插件目錄下的 `data/config.json` 中配置:
112
-
113
- | 欄位名稱 | 型別 | 預設值 | 說明 |
114
- | :--- | :--- | :--- | :--- |
115
- | **`masterUsername`** | string | `""` | 主人的 Instagram 使用者名稱(達標時在留言區 @主人 推薦) |
116
- | **`interestTags`** | array | `["ai", "deepseek", "coding", "tech"]` | 主人感興趣的主題標籤或領域關鍵字清單 |
117
- | **`personaPrompt`** | string | *預設人設提示詞* | 評估貼文趣味度與撰寫 @主人 推薦語的人設 Prompt |
118
- | **`minScore`** | number | `75` | 推坑門檻分數(0-100,達標才在貼文下留言推薦) |
119
- | **`dailyRecommendCap`** | number | `5` | 每日向主人推坑留言的上限則數(防止過度打擾與風控) |
120
- | **`scrollIntervalMinutes`**| number | `60` | 自動巡查刷動態牆的時間週期(分鐘) |
121
- | **`autoScrollEnabled`** | boolean| `true` | 是否啟用背景定時自動刷動態牆任務 |
122
- | **`likeOnRecommend`** | boolean| `true` | 決定推薦給主人時是否順便對該貼文點讚 |
123
- | **`batchSize`** | number | `15` | 每輪滾動瀏覽抓取的貼文筆數 (10-30) |
124
-
125
- ---
126
-
127
- ## 📁 目錄結構
128
-
129
- ```text
130
- dsh-instagram-scroll/
131
- ├── cordis.patch.yml # DSH bundle patch 宣告
132
- ├── package.json # 模組定義與依賴
133
- ├── tsconfig.json # TypeScript 編譯設定
134
- ├── assets/
135
- │ └── banner.png # 宣傳橫幅
136
- ├── client.js # DSH Web 前端面板 (動態瀏覽、手動觸發、日報查看)
137
- ├── data/
138
- │ ├── config.json # 本地設定檔
139
- │ ├── scroll_ledger.json # 瀏覽去重與統計帳本
140
- │ └── reports/ # 每日日報儲存目錄 (YYYY-MM-DD.md)
141
- └── src/
142
- ├── index.ts # Cordis 外掛入口、排程定時器與 Web API
143
- ├── config.ts # Schemastery 設定模型
144
- ├── types.d.ts # 型別宣告
145
- ├── core/
146
- │ └── scrollDuty.ts # 滾動瀏覽、大模型評估、點讚與推坑核心邏輯
147
- ├── lib/
148
- │ ├── hostdeps.ts # DSH 宿主相容層
149
- │ └── ledger.ts # 日報生成與歷史去重帳本管理器
150
- └── tools/
151
- └── scrollTools.ts # 向 DSH Tools 註冊之專用滾動瀏覽工具
152
- ```
153
-
154
- ---
155
-
156
- ## 📄 授權條款
157
-
158
- 本專案採用 [MIT License](LICENSE) 開源授權。
1
+ # DSH Instagram Scroll Feed & Exploration Plugin (`@luoyi-dsh/instagram-scroll`)
2
+
3
+ <div align="center">
4
+
5
+ ![DSH Instagram Scroll Banner](assets/banner.png)
6
+
7
+ **[English](README.md) | [繁體中文](README.zh-Hant.md)**
8
+
9
+ </div>
10
+
11
+ > Dedicated Instagram feed exploration, AI recommendation, and daily digest plugin for **DeepSeek Harness (DSH)**.
12
+ > Core capabilities: **Automatically or manually browse Instagram timeline feeds and topic hashtags on behalf of the user, evaluate post relevance against the owner's interests using LLMs, like and leave authentic recommendation comments, and aggregate highlights into daily Markdown reports**.
13
+
14
+ > [!CAUTION]
15
+ > ### ⚠️ CRITICAL WARNING & DISCLAIMER
16
+ > 1. **Violation of Instagram Terms of Service & Community Guidelines**:
17
+ > This plugin and its automated feed browsing, liking, and commenting routines operate via unofficial APIs, which **expressly violates Instagram / Meta's Terms of Use and Community Guidelines**.
18
+ > 2. **DO NOT USE YOUR PERSONAL / PRIMARY ACCOUNT**:
19
+ > **Never run this plugin using your personal, primary, or business Instagram account!** Automated browsing and repeated comment posting are quickly flagged by Instagram's anti-scraping and bot-detection heuristics, resulting in: **Action Blocks, Challenge Checkpoints, temporary locks, and PERMANENT ACCOUNT SUSPENSION / BANNING**.
20
+ > 3. **Use Dedicated Burner / Alt Accounts & Clean Proxies**:
21
+ > Only run this plugin on disposable secondary accounts (burner/alt accounts) with dedicated residential proxies. Avoid sudden geographic IP changes.
22
+ > 4. **Built-in Anti-Risk Safeguards**:
23
+ > - **Per-Run Action Cap**: Strictly limits recommendations to at most 1 per scroll run (`maxRecommendsPerRun: 1`) to avoid burst posting.
24
+ > - **Humanized Reading Delays**: Injects randomized 3–7s reading delays between scanning candidate posts (`minPostReadDelaySeconds: 3, maxPostReadDelaySeconds: 7`).
25
+ > - **Action Jitter**: Enforces 6–15s randomized delays before executing comments or likes.
26
+ > - **Circuit Breaker Cooldown**: Automatically pauses all exploration for 30 minutes if an Action Block or rate limit is encountered.
27
+ > 5. **Disclaimer**:
28
+ > This project is provided strictly for educational and technical research purposes. The developers and contributors accept **no responsibility or liability** for any account bans, suspensions, or losses resulting from its use. Use entirely at your own risk!
29
+
30
+ ---
31
+
32
+ ## 🌟 Key Features
33
+
34
+ 1. **Automated Feed Browsing (Scroll Duty)**:
35
+ - Periodically polls timeline feeds and configured topic hashtags.
36
+ - Extracts post caption, author, tags, and media metadata.
37
+ 2. **Deep Content Inspection & User Preference Alignment**:
38
+ - **No Superficial Recommendations**: Abandons simple hashtag-only / high-like criteria; threshold raised to score 80.
39
+ - **Caption & Tag Separation**: Dissects raw captions to separate genuine body text from trailing hashtags and mentions. Posts with substantive body text shorter than `minCaptionLength` (30 chars) are discarded.
40
+ - **Hashtag Spam / Farm Detection**: Flags and drops posts where tags dominate over meaningful content.
41
+ - **Body Topic Verification**: Mandates that master's interest keywords/topics genuinely appear within the post body (`requireBodyMatch`).
42
+ - **Negative / Spam Filtering**: Instantly filters out giveaways, mutual-follows, dropshipping, gambling, emotional clickbait, and superficial selfie/meme posts.
43
+ - **LLM Semantic Review & Tailored Hook**: Evaluates true content substance via LLM or robust heuristic review, synthesizing custom authentic recommendation comments.
44
+ 3. **Daily Markdown Digest (`data/reports/YYYY-MM-DD.md`)**:
45
+ - Automatically organizes reviewed posts, summaries, and recommendation trails into clean Markdown daily digests.
46
+ - Viewable directly in the web console.
47
+ 4. **State Ledger & Deduplication**:
48
+ - `data/scroll_ledger.json` keeps track of inspected media PKs and daily quotas to prevent repetitive actions and avoid rate limits.
49
+ 5. **DSH Web Control Panel (`client.js`)**:
50
+ - Provides an intuitive feed waterfall preview, manual duty execution button, daily report reader, and settings inspector.
51
+
52
+ ---
53
+
54
+ ## 📦 Installation
55
+
56
+ Install via DSH Plugin CLI:
57
+
58
+ ```bash
59
+ dsh plugin --profile web add @luoyi-dsh/instagram-scroll
60
+ ```
61
+
62
+ Or via standard npm:
63
+
64
+ ```bash
65
+ npm install @luoyi-dsh/instagram-scroll
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 🛠️ Provided DSH Tools
71
+
72
+ | Tool Name | Description | Parameters |
73
+ | :--- | :--- | :--- |
74
+ | **`ig_run_scroll_duty_now`** | Trigger an immediate exploration duty cycle (evaluate posts, like & recommend) | None |
75
+ | **`ig_scroll_feed`** | Read timeline feed posts (author, like count, caption excerpt) | `limit` (number, default 15, max 50) |
76
+ | **`ig_explore_topics`** | Explore popular posts under a specific topic or hashtag | `tag` (string, required), `limit` (number, default 15) |
77
+ | **`ig_like_feed_post`** | Like an Instagram post during browsing | `media_pk` (string, required) |
78
+
79
+ ---
80
+
81
+ ## 💻 Usage Examples
82
+
83
+ ### 1. Natural Language Invocation in DSH Chat
84
+
85
+ ```text
86
+ 💬 Example 1: Run full exploration and recommendation duty
87
+ "Please check my Instagram feed right now and recommend any interesting technical posts."
88
+ -> AI calls: ig_run_scroll_duty_now()
89
+
90
+ 💬 Example 2: Read timeline posts
91
+ "Browse the latest 10 posts on my Instagram feed."
92
+ -> AI calls: ig_scroll_feed(limit=10)
93
+
94
+ 💬 Example 3: Explore a hashtag
95
+ "Explore top posts under #deepseek on Instagram."
96
+ -> AI calls: ig_explore_topics(tag="deepseek", limit=15)
97
+ ```
98
+
99
+ ---
100
+
101
+ ### 2. Via HTTP REST API (DSH Web Routes)
102
+
103
+ > 💡 **Tip**: Default DSH Web port is **3080**.
104
+
105
+ #### 1. Manually Trigger Duty Cycle (`POST /api/instagram/scroll/run`)
106
+ ```bash
107
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/run
108
+ ```
109
+
110
+ #### 2. Get Current Status & Daily Stats (`GET /api/instagram/scroll/status`)
111
+ ```bash
112
+ curl http://127.0.0.1:3080/api/instagram/scroll/status
113
+ ```
114
+
115
+ #### 3. Read Today's Markdown Digest (`GET /api/instagram/scroll/report`)
116
+ ```bash
117
+ curl http://127.0.0.1:3080/api/instagram/scroll/report
118
+ ```
119
+
120
+ #### 4. Read & Update Configuration (`GET / POST /api/instagram/scroll/config`)
121
+ ```bash
122
+ # Read config
123
+ curl http://127.0.0.1:3080/api/instagram/scroll/config
124
+
125
+ # Update config
126
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/config \
127
+ -H "Content-Type: application/json" \
128
+ -d '{"masterUsername":"your_username","minScore":80}'
129
+ ```
130
+
131
+ ---
132
+
133
+ ## ⚙️ Configuration Parameters (Settings)
134
+
135
+ > 💡 **Tip**: No need to configure Instagram credentials here; it automatically inherits session state from `@luoyi-dsh/instagram-mcp`.
136
+
137
+ | Field | Type | Default | Description |
138
+ | :--- | :--- | :--- | :--- |
139
+ | **`masterUsername`** | string | `""` | Master's Instagram username (mentioned in comments when recommended) |
140
+ | **`userInterests`** | string | *Default persona description* | Detailed description of owner's topics, taste, and technical expectations |
141
+ | **`positiveKeywords`** | array | `["ai", "deepseek", ...]` | High-priority positive topic keywords required in post body |
142
+ | **`negativeKeywords`** | array | `["互粉", "代購", "抽獎", ...]` | Negative / spam blacklist words to immediately reject |
143
+ | **`minCaptionLength`** | number | `30` | Minimum character length of genuine post body (excluding hashtags) |
144
+ | **`requireBodyMatch`** | boolean| `true` | Body text must substantiate owner's preferences (rejects tag-only matches) |
145
+ | **`strictContentCheck`**| boolean| `true` | Enables deep content inspection pipeline before commenting |
146
+ | **`interestTags`** | array | `["ai", "deepseek", "coding", "tech", "gadgets"]` | Exploration starting tags (not sole recommendation criteria) |
147
+ | **`personaPrompt`** | string | *Default persona prompt* | Persona prompt guiding post analysis and recommendation copywriting |
148
+ | **`minScore`** | number | `80` | Recommendation score threshold (0-100; elevated to avoid spam) |
149
+ | **`dailyRecommendCap`** | number | `5` | Maximum recommendation comments allowed per day |
150
+ | **`maxRecommendsPerRun`**| number | `1` | Max recommendations per duty run to prevent bursting |
151
+ | **`minPostReadDelaySeconds`** | number | `3` | Minimum human reading pacing delay between posts |
152
+ | **`maxPostReadDelaySeconds`** | number | `7` | Maximum human reading pacing delay between posts |
153
+ | **`cooldownOnBlockMinutes`** | number | `30` | Automatic circuit breaker cooldown minutes upon action blocks |
154
+ | **`scrollIntervalMinutes`**| number | `60` | Background exploration duty interval in minutes |
155
+ | **`autoScrollEnabled`** | boolean| `true` | Whether background automated exploration duty is enabled |
156
+ | **`likeOnRecommend`** | boolean| `true` | Automatically like post upon recommending to master |
157
+ | **`batchSize`** | number | `15` | Number of posts inspected per scroll duty round (10-30) |
158
+
159
+ ---
160
+
161
+ ## 📁 Directory Structure
162
+
163
+ ```text
164
+ dsh-instagram-scroll/
165
+ ├── cordis.patch.yml # DSH bundle patch manifest
166
+ ├── package.json # Module definitions and dependencies
167
+ ├── tsconfig.json # TypeScript compiler configuration
168
+ ├── CHANGELOG.md # Version release notes
169
+ ├── README.md # English documentation (This file)
170
+ ├── README.zh-Hant.md # Traditional Chinese documentation
171
+ ├── assets/
172
+ │ ├── banner.png # Promotional banner
173
+ │ └── zh-Hant.md # Localized documentation
174
+ ├── client.js # DSH Web UI panel
175
+ ├── data/ # [Runtime generated, ignored in Git]
176
+ │ ├── config.json # Local configuration
177
+ │ ├── scroll_ledger.json # Deduplication and quota ledger
178
+ │ └── reports/ # Daily reports folder (YYYY-MM-DD.md)
179
+ └── src/
180
+ ├── index.ts # Cordis plugin entrypoint and Web API
181
+ ├── config.ts # Schemastery config schema
182
+ ├── types.d.ts # Type definitions
183
+ ├── core/
184
+ │ └── scrollDuty.ts # Scroll duty execution, LLM evaluation, likes & comments
185
+ ├── lib/
186
+ │ ├── hostdeps.ts # DSH runtime compatibility layer
187
+ │ └── ledger.ts # Daily digest and history ledger manager
188
+ └── tools/
189
+ └── scrollTools.ts # Dedicated DSH tools registration
190
+ ```
191
+
192
+ ---
193
+
194
+ ## 📜 Releases & Changelog
195
+
196
+ For detailed release history and changes, please refer to [CHANGELOG.md](CHANGELOG.md).
197
+
198
+ ---
199
+
200
+ ## 📄 License
201
+
202
+ This project is licensed under the [MIT License](LICENSE).
@@ -0,0 +1,204 @@
1
+ # DSH Instagram 滾動瀏覽與探索插件 (`@luoyi-dsh/instagram-scroll`)
2
+
3
+ <div align="center">
4
+
5
+ ![DSH Instagram Scroll Banner](assets/banner.png)
6
+
7
+ **[English](README.md) | [繁體中文](README.zh-Hant.md)**
8
+
9
+ </div>
10
+
11
+ > **DeepSeek Harness (DSH)** 專屬的 Instagram 動態探索、智慧推坑與日報生成外掛。
12
+ > 具備核心能力:**定時或手動替主人刷一輪 Instagram 首頁動態與主題標籤、逐條閱讀內文評估主人興趣、自動點讚與留言推坑,並自動彙整生成每日 Markdown 探索日報**。
13
+
14
+ > [!CAUTION]
15
+ > ### ⚠️ 重要風險警告與免責聲明 (CRITICAL DISCLAIMER)
16
+ > 1. **違反 Instagram 社群守則與使用條款**:
17
+ > 本插件及其背後的自動化刷動態、自動按讚與自動 @主人推坑留言機制,**明確違反了 Instagram / Meta 的《服務條款 (Terms of Use)》及《社群守則 (Community Guidelines)》**。
18
+ > 2. **切勿使用本人主要帳號運行 (DO NOT USE YOUR PRIMARY ACCOUNT)**:
19
+ > **強烈嚴禁使用您個人的日常主要帳號、官方認證帳號或重要商業帳號!** Instagram 擁有極為敏銳的反機器人檢測演算法,持續的動態滾動、頻繁讀取及自動留評極易觸發官方風控,導致:**功能限制 (Action Blocked)、強制安全挑戰 (Challenge Checkpoint)、帳號臨時鎖定、甚至永久停權封號 (Permanent Ban)**!
20
+ > 3. **測試與備用小號原則**:
21
+ > 若需測試本外掛,請務必使用**無重要資料的測試用小號 (Burner / Alt Account)**,並強烈建議配置**優質純淨的住宅代理伺服器 (Residential Proxy)**,切勿在短時間內切換不同國家/地區的 IP。
22
+ > 4. **內建防風控安全機制**:
23
+ > - **單輪推坑上限**:每輪滾動瀏覽最多僅推薦 1 則內容 (`maxRecommendsPerRun: 1`),杜絕短時間密集推坑。
24
+ > - **擬真閱讀微延遲**:每掃描一則貼文前隨機等待 3~7 秒 (`minPostReadDelaySeconds: 3, maxPostReadDelaySeconds: 7`),模擬真人滑動與停留閱讀。
25
+ > - **動作抖動延遲**:留言與點讚動作注入 6~15 秒隨機抖動等待 (Jitter)。
26
+ > - **風控熔斷保護**:遇到官方 Action Block / 頻率限制異常時,自動觸發 30 分鐘冷卻保護模式,暫停一切自動化推薦。
27
+ > 5. **免責宣告**:
28
+ > 本專案純屬程式技術研究與開源通訊協定評估用途。使用者因安裝、運行或配置本外掛所導致之任何帳號停權、封禁、資料損失或相關責任,**開發者一概不負任何法律與連帶賠償責任**,使用時請務必審慎評估並自負風險!
29
+
30
+ ---
31
+
32
+ ## 🌟 核心特性
33
+
34
+ 1. **自動動態探索巡查 (Scroll Duty)**:
35
+ - 定期輪詢首頁動態牆 (Timeline Feed) 與指定主題標籤 (Hashtags)。
36
+ - 逐則貼文抓取標題、作者、標籤與完整內文。
37
+ 2. **正文深度審查與用戶偏好推薦 (Content Inspection Pipeline)**:
38
+ - **絕不隨便推薦**:徹底拋棄僅看 tag 與點讚數的粗糙過濾,門檻提高至 80 分。
39
+ - **正文與標籤徹底分離**:自動分離真實正文與文末 `#標籤`,有效字數過短或僅有單一 emoji 者直接判定為無實質內容過濾。
40
+ - **標籤農場攔截**:偵測標籤堆砌蹭熱度(Hashtag Spamming),杜絕空洞蹭流量貼文。
41
+ - **正文主題實質核驗**:正文必須切實探討主人喜愛的領域與關鍵詞,禁止僅在文末掛標籤蹭熱度。
42
+ - **負向廣告與垃圾過濾**:自動排除互粉、代購、抽獎、博彩、微商、心靈雞湯與純自拍娛樂等無效內容。
43
+ - **LLM / 語義深度質檢與客製化推坑詞**:結合主人喜好描述,由 LLM 或深度啟發式引擎審查真實主旨,並針對貼文亮點生成專屬真誠推薦詞,在留言區 `@主人`。
44
+ 3. **每日探索日報 (Daily Markdown Report)**:
45
+ - 自動將今日瀏覽之所有精選貼文、摘要與推薦紀錄整理為 Markdown 日報。
46
+ - 儲存於 `data/reports/YYYY-MM-DD.md`,可隨時在 Web 面板查看與回溯。
47
+ 4. **狀態帳本與嚴格去重控制**:
48
+ - `data/scroll_ledger.json` 記錄已看貼文 PK 與今日推坑次數,避免重複推坑或重複閱讀,並防止觸發風控。
49
+ 5. **DSH Web 瀏覽器端介面 (`client.js`)**:
50
+ - 提供直觀動態牆瀑布流預覽、即時手動觸發刷動態按鈕、日報閱讀器與自訂設定面板。
51
+
52
+ ---
53
+
54
+ ## 📦 安裝方式
55
+
56
+ 使用 DSH CLI 安裝插件:
57
+
58
+ ```bash
59
+ dsh plugin --profile web add @luoyi-dsh/instagram-scroll
60
+ ```
61
+
62
+ 或透過 npm 安裝:
63
+
64
+ ```bash
65
+ npm install @luoyi-dsh/instagram-scroll
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 🛠️ 提供之 DSH Tools
71
+
72
+ | 工具名稱 | 說明 | 參數 |
73
+ | :--- | :--- | :--- |
74
+ | **`ig_run_scroll_duty_now`** | 立即手動替主人刷一輪 Instagram 動態與探索,讀取貼文進行評估、點讚與留言推坑 | 無 |
75
+ | **`ig_scroll_feed`** | 滾動讀取 Instagram 時間軸最新動態貼文(含作者、讚數、內文摘要) | `limit` (number,預設 15,最大 50) |
76
+ | **`ig_explore_topics`** | 依照指定主題或探索標籤滾動閱讀熱門貼文 | `tag` (string,必填), `limit` (number,預設 15) |
77
+ | **`ig_like_feed_post`** | 在滾動瀏覽過程中對感興趣的 Instagram 貼文按讚 | `media_pk` (string,必填) |
78
+
79
+ ---
80
+
81
+ ## 💻 使用範例
82
+
83
+ ### 1. DSH AI 自然語言直接調用
84
+
85
+ 在 DSH 對話中,主模型可直接以自然語言執行滾動探索或瀏覽:
86
+
87
+ ```text
88
+ 💬 範例 1:執行一輪完整的動態探索與推坑
89
+ 「請立刻替我刷一輪 Instagram 動態牆,看看有沒有適合我的技術新貼文並推薦給我」
90
+ -> AI 將調用:ig_run_scroll_duty_now()
91
+
92
+ 💬 範例 2:滾動瀏覽首頁動態貼文
93
+ 「幫我刷最新 10 則 Instagram 動態」
94
+ -> AI 將調用:ig_scroll_feed(limit=10)
95
+
96
+ 💬 範例 3:探索特定主題標籤
97
+ 「探索 Instagram 上 #deepseek 標籤的熱門貼文」
98
+ -> AI 將調用:ig_explore_topics(tag="deepseek", limit=15)
99
+ ```
100
+
101
+ ---
102
+
103
+ ### 2. 透過 HTTP REST API 調用 (DSH Web 路由)
104
+
105
+ > 💡 **提示**:DSH Web 預設埠號為 **3080**。
106
+
107
+ #### 1. 手動觸發滾動一輪 (`POST /api/instagram/scroll/run`)
108
+ ```bash
109
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/run
110
+ ```
111
+
112
+ #### 2. 獲取當前滾動狀態與今日統計 (`GET /api/instagram/scroll/status`)
113
+ ```bash
114
+ curl http://127.0.0.1:3080/api/instagram/scroll/status
115
+ ```
116
+
117
+ #### 3. 讀取今日探索日報內容 (`GET /api/instagram/scroll/report`)
118
+ ```bash
119
+ curl http://127.0.0.1:3080/api/instagram/scroll/report
120
+ ```
121
+
122
+ #### 4. 讀取與更新設定 (`GET / POST /api/instagram/scroll/config`)
123
+ ```bash
124
+ # 取得設定
125
+ curl http://127.0.0.1:3080/api/instagram/scroll/config
126
+
127
+ # 更新設定
128
+ curl -X POST http://127.0.0.1:3080/api/instagram/scroll/config \
129
+ -H "Content-Type: application/json" \
130
+ -d '{"masterUsername":"your_username","minScore":80}'
131
+ ```
132
+
133
+ ---
134
+
135
+ ## ⚙️ 設定參數說明 (Settings)
136
+
137
+ > 💡 **提示**:本外掛**不用輸入帳號密碼**,會直接沿用依賴的 `@luoyi-dsh/instagram-mcp` 獲取之 Session 與登入狀態。
138
+
139
+ | 欄位名稱 | 型別 | 預設值 | 說明 |
140
+ | :--- | :--- | :--- | :--- |
141
+ | **`masterUsername`** | string | `""` | 主人的 Instagram 使用者名稱(達標時在留言區 @主人 推薦) |
142
+ | **`userInterests`** | string | *預設偏好詳述* | 主人喜歡的內容風格與領域詳細描述(供 AI 深度比對正文語義) |
143
+ | **`positiveKeywords`** | array | `["ai", "deepseek", ...]` | 正文必須提及或重點加分的領域關鍵字清單 |
144
+ | **`negativeKeywords`** | array | `["互粉", "代購", "抽獎", ...]` | 負向排除關鍵字(命中時直接判定不推薦,杜絕廣告與廢文) |
145
+ | **`minCaptionLength`** | number | `30` | 正文有效文字最小字數門檻(扣除 #標籤 後過短者直接過濾) |
146
+ | **`requireBodyMatch`** | boolean| `true` | 正文實質內容必須命中主人偏好主題(拒絕僅在文末蹭 tag) |
147
+ | **`strictContentCheck`**| boolean| `true` | 啟用 @ 前深度正文審查機制(結合 LLM / 正文語義深度質檢) |
148
+ | **`interestTags`** | array | `["ai", "deepseek", "coding", "tech", "gadgets"]` | 探索抓取的主題標籤(僅作為探索起點,非推薦唯一標準) |
149
+ | **`personaPrompt`** | string | *預設人設提示詞* | 評估貼文趣味度與撰寫 @主人 推薦語的人設 Prompt |
150
+ | **`minScore`** | number | `80` | 推坑門檻分數(0-100,達標才在貼文下留言推薦,提高門檻避免隨便推薦) |
151
+ | **`dailyRecommendCap`** | number | `5` | 每日向主人推坑留言的上限則數(防止過度打擾與風控) |
152
+ | **`maxRecommendsPerRun`**| number | `1` | 單次滾動瀏覽最多推坑留言則數(避免短時間連發觸發官方風控) |
153
+ | **`minPostReadDelaySeconds`** | number | `3` | 每讀取一則貼文前人造擬真閱讀微延遲最小秒數 |
154
+ | **`maxPostReadDelaySeconds`** | number | `7` | 每讀取一則貼文前人造擬真閱讀微延遲最大秒數 |
155
+ | **`cooldownOnBlockMinutes`** | number | `30` | 遇到 Action Block / 頻率限制時自動熔斷暫停分鐘數 |
156
+ | **`scrollIntervalMinutes`**| number | `60` | 自動巡查刷動態牆的時間週期(分鐘) |
157
+ | **`autoScrollEnabled`** | boolean| `true` | 是否啟用背景定時自動刷動態牆任務 |
158
+ | **`likeOnRecommend`** | boolean| `true` | 決定推薦給主人時是否順便對該貼文點讚 |
159
+ | **`batchSize`** | number | `15` | 每輪滾動瀏覽抓取的貼文筆數 (10-30) |
160
+
161
+ ---
162
+
163
+ ## 📁 目錄結構
164
+
165
+ ```text
166
+ dsh-instagram-scroll/
167
+ ├── cordis.patch.yml # DSH bundle patch 宣告
168
+ ├── package.json # 模組定義與依賴
169
+ ├── tsconfig.json # TypeScript 編譯設定
170
+ ├── CHANGELOG.md # 版本更新紀錄
171
+ ├── README.md # 英文說明文件
172
+ ├── README.zh-Hant.md # 繁體中文說明文件
173
+ ├── assets/
174
+ │ ├── banner.png # 宣傳橫幅
175
+ │ └── zh-Hant.md # 本地化說明文件
176
+ ├── client.js # DSH Web 前端面板 (動態瀏覽、手動觸發、日報查看)
177
+ ├── data/
178
+ │ ├── config.json # 本地設定檔
179
+ │ ├── scroll_ledger.json # 瀏覽去重與統計帳本
180
+ │ └── reports/ # 每日日報儲存目錄 (YYYY-MM-DD.md)
181
+ └── src/
182
+ ├── index.ts # Cordis 外掛入口、排程定時器與 Web API
183
+ ├── config.ts # Schemastery 設定模型
184
+ ├── types.d.ts # 型別宣告
185
+ ├── core/
186
+ │ └── scrollDuty.ts # 滾動瀏覽、大模型評估、點讚與推坑核心邏輯
187
+ ├── lib/
188
+ │ ├── hostdeps.ts # DSH 宿主相容層
189
+ │ └── ledger.ts # 日報生成與歷史去重帳本管理器
190
+ └── tools/
191
+ └── scrollTools.ts # 向 DSH Tools 註冊之專用滾動瀏覽工具
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 📜 版本發布紀錄 (Releases)
197
+
198
+ 詳細版本演進與更新紀錄,請參閱 [CHANGELOG.md](CHANGELOG.md)。
199
+
200
+ ---
201
+
202
+ ## 📄 授權條款
203
+
204
+ 本專案採用 [MIT License](LICENSE) 開源授權。