claude-code streaming chat, desktop remote viewer, new-automation route, tiktok task v4, misc fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-02 20:00:45 +00:00
co-authored by Claude Opus 4.6
parent 0068244356
commit 40a9768cb3
91 changed files with 17872 additions and 85 deletions
+21 -41
View File
@@ -1,7 +1,7 @@
---
name: TikTok Trends
description: Fetch top trending TikTok videos for a given country and generate an engagement report with optional video downloads.
version: 3
version: 4
author: pastilhas
tags:
- social-media
@@ -136,8 +136,8 @@ $HOME/tiktok-trends/tiktok_trends_<country>_<YYYYMMDD_HHMMSS>/
Call the `apify` tool with `output_path` pointing to `raw.json` in the output directory:
```
apify(
actor_id: "novi~fast-tiktok-scraper",
input: { "type": "TREND", "region": "<country>", "maxItems": <limit> },
actor_id: "clockworks~tiktok-trends-scraper",
input: { "adsCountryCode": "<country>", "resultsPerPage": <limit> },
output_path: "<output_dir>/raw.json"
)
```
@@ -148,7 +148,7 @@ The tool saves the full dataset to `raw.json` and returns a summary (item count)
**Important:** The raw JSON file is too large to read directly (exceeds the 50KB read limit). Instead, write a Node.js script (e.g. `generate-report.js`) in the output directory that reads `raw.json`, processes the data, and writes `report.md`. Then execute it with `node generate-report.js`. Delete the script after it runs successfully.
The script should read `raw.json`, parse it as a JSON array of video items, and write `report.md` with the following sections:
The script should read `raw.json`, parse the JSON (it may be an array directly or an object with items nested inside), and write `report.md` with the following sections. Adapt field names based on the actual data structure (see Data Shape Reference):
#### Header
```markdown
@@ -159,7 +159,7 @@ Total videos analyzed: <count>
#### Engagement Summary
Build a table from each video's `statistics` object (`play_count`, `digg_count`, `share_count`, `comment_count`):
Build a table from each video's statistics (views/plays, likes/diggs, shares, comments):
| Metric | Total | Avg per video |
|--------|------:|-------------:|
@@ -170,21 +170,21 @@ Build a table from each video's `statistics` object (`play_count`, `digg_count`,
#### Top Hashtags (up to 20)
Extract hashtags from each video's `text_extra` array (entries where `hashtag_name` is set). If `text_extra` is empty, fall back to parsing `#tags` from the `desc` field. Count occurrences, sort descending.
Extract hashtags from the data (dedicated hashtag field or parse `#tags` from description). Count occurrences, sort descending.
| Hashtag | Count |
|---------|------:|
#### Top Sounds (up to 10)
From each video's `music` object, format as `title — author`. Count occurrences, sort descending.
From each video's music/sound metadata, format as `title — author`. Count occurrences, sort descending.
| Sound | Count |
|-------|------:|
#### Creators Appearing in Trending (up to 10)
From each video's `author.unique_id`. Count occurrences, sort descending.
From each video's author/creator field. Count occurrences, sort descending.
| Creator | Videos |
|---------|-------:|
@@ -196,9 +196,9 @@ Full table of all videos, sorted by position:
| # | Creator | Description | Views | Likes | URL |
|--:|---------|-------------|------:|------:|-----|
- Creator: `@author.unique_id`
- Description: first 60 chars of `desc`, pipe and newline characters replaced, with `...` if truncated
- URL: `share_url`
- Creator: `@username` from the author field
- Description: first 60 chars, pipe and newline characters replaced, with `...` if truncated
- URL: the video's share/web URL
- Format numbers with locale separators (e.g. `1,234,567`)
### 4. Download videos (only if `download` is true)
@@ -224,35 +224,15 @@ Print a summary to the user:
## Data Shape Reference
Each video item from the actor has this structure:
```json
{
"aweme_id": "string",
"desc": "video description with #hashtags",
"create_time": 1234567890,
"share_url": "https://www.tiktok.com/@user/video/123",
"author": {
"unique_id": "username",
"nickname": "Display Name",
"uid": "123"
},
"statistics": {
"play_count": 1000000,
"digg_count": 50000,
"share_count": 5000,
"comment_count": 2000,
"collect_count": 1000,
"download_count": 500
},
"music": {
"title": "Sound Name",
"author": "Sound Author"
},
"text_extra": [
{ "hashtag_name": "trending", "type": 1 }
]
}
```
The actor output format may vary between versions. Before writing the report generation script, inspect the first item of the dataset to discover the actual field names. Write the script to handle the fields it finds. Common field patterns across TikTok scraper actors:
- **Video ID**: `aweme_id`, `id`, or `videoId`
- **Description**: `desc`, `description`, or `title`
- **Video URL**: `share_url`, `url`, `videoUrl`, or `webVideoUrl`
- **Author**: `author.unique_id`, `author.uniqueId`, `authorMeta.name`, or `nickname`
- **Statistics**: Look for objects with keys like `play_count`/`playCount`, `digg_count`/`diggCount`/`likes`, `share_count`/`shareCount`/`shares`, `comment_count`/`commentCount`/`comments`
- **Music/Sound**: `music.title`, `musicMeta.musicName`, or similar
- **Hashtags**: `text_extra[].hashtag_name`, `hashtags[]`, or parse `#tags` from description
## Error Handling
@@ -267,5 +247,5 @@ Each video item from the actor has this structure:
## Notes
- The Apify actor may take 1-3 minutes depending on the limit
- Each run uses Apify compute units — monitor at https://console.apify.com/billing
- Pricing: $0.005 per start + $0.003 per result — monitor at https://console.apify.com/billing
- Not all countries have sufficient trending data; some may return fewer results than requested