@akilles/soundcloud-watcher 2.0.3 → 2.0.5
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 +69 -123
- package/index.ts +24 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/soundcloud_watcher.ts +3 -0
package/README.md
CHANGED
|
@@ -2,214 +2,160 @@
|
|
|
2
2
|
|
|
3
3
|
Monitor your SoundCloud account and track artist releases. Get notified when someone follows you, likes your tracks, or when artists you care about drop new music.
|
|
4
4
|
|
|
5
|
-
|
|
6
5
|
## Features
|
|
7
6
|
|
|
8
7
|
- **Follower tracking** - See who followed you recently
|
|
9
8
|
- **Track engagement** - Monitor who liked your tracks
|
|
10
9
|
- **New releases** - Get notifications when tracked artists release new music
|
|
11
|
-
- **Smart API usage** - Only fetches what changed, automatically skips dormant artists
|
|
10
|
+
- **Smart API usage** - Only fetches what changed, automatically skips dormant artists
|
|
12
11
|
- **Rate limit handling** - Exponential backoff for API reliability
|
|
13
|
-
- **Automatic background checking** - Configurable interval (default: 6 hours)
|
|
14
|
-
- **Session-agnostic notifications** - Works with any OpenClaw session (Telegram, Discord, etc.)
|
|
15
12
|
|
|
16
13
|
## Prerequisites
|
|
17
14
|
|
|
18
15
|
- OpenClaw gateway running
|
|
19
16
|
- Node.js 22+ installed
|
|
20
|
-
- SoundCloud API credentials
|
|
17
|
+
- SoundCloud API credentials
|
|
21
18
|
|
|
22
19
|
## Quick Start
|
|
23
20
|
|
|
24
21
|
### 1. Install
|
|
25
22
|
|
|
26
23
|
```bash
|
|
27
|
-
# From npm (recommended)
|
|
28
24
|
openclaw plugins install @akilles/soundcloud-watcher
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
git clone https://github.com/wlinds/openclaw-soundcloud-watcher
|
|
32
|
-
openclaw plugins install -l ./openclaw-soundcloud-watcher/openclaw-soundcloud-watcher
|
|
25
|
+
openclaw plugins enable soundcloud-watcher
|
|
26
|
+
openclaw gateway restart
|
|
33
27
|
```
|
|
34
28
|
|
|
35
|
-
|
|
36
29
|
### 2. Get SoundCloud Credentials
|
|
37
30
|
|
|
38
31
|
1. Log into SoundCloud
|
|
39
32
|
2. Go to [soundcloud.com/you/apps](https://soundcloud.com/you/apps)
|
|
40
33
|
3. Click "Register a new application"
|
|
41
|
-
4. Fill in name and website
|
|
42
|
-
5. Copy your **Client ID** and **Client Secret**
|
|
34
|
+
4. Fill in name and website (any URL works)
|
|
35
|
+
5. Copy your **Client ID** and **Client Secret**
|
|
43
36
|
|
|
44
37
|
### 3. Configure
|
|
45
38
|
|
|
46
|
-
|
|
39
|
+
Create the credentials file:
|
|
47
40
|
|
|
48
41
|
```bash
|
|
49
|
-
/soundcloud
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Then edit `~/.openclaw/openclaw.json` and paste your credentials:
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
{
|
|
56
|
-
"plugins": {
|
|
57
|
-
"enabled": true,
|
|
58
|
-
"entries": {
|
|
59
|
-
"soundcloud-watcher": {
|
|
60
|
-
"enabled": true,
|
|
61
|
-
"config": {
|
|
62
|
-
"clientId": "YOUR_CLIENT_ID",
|
|
63
|
-
"clientSecret": "YOUR_CLIENT_SECRET",
|
|
64
|
-
"username": "your_soundcloud_username",
|
|
65
|
-
"checkIntervalHours": 6,
|
|
66
|
-
"myTracksLimit": 10,
|
|
67
|
-
"dormantDays": 90,
|
|
68
|
-
"sessionKey": "agent:main:main"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
42
|
+
nano ~/.openclaw/secrets/soundcloud.env
|
|
74
43
|
```
|
|
75
44
|
|
|
76
|
-
|
|
45
|
+
Add your credentials:
|
|
77
46
|
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
47
|
+
```
|
|
48
|
+
SOUNDCLOUD_CLIENT_ID=your_client_id
|
|
49
|
+
SOUNDCLOUD_CLIENT_SECRET=your_client_secret
|
|
50
|
+
MY_USERNAME=your_soundcloud_username
|
|
82
51
|
```
|
|
83
52
|
|
|
84
|
-
###
|
|
53
|
+
### 4. Restart & Verify
|
|
85
54
|
|
|
86
55
|
```bash
|
|
87
|
-
|
|
88
|
-
/soundcloud-add noisia
|
|
89
|
-
/soundcloud-list
|
|
56
|
+
openclaw gateway restart
|
|
90
57
|
```
|
|
91
58
|
|
|
92
|
-
|
|
59
|
+
Then in chat:
|
|
60
|
+
```
|
|
61
|
+
/soundcloud-setup # Should show "Already configured!"
|
|
62
|
+
/soundcloud-status # Should show your account info
|
|
63
|
+
```
|
|
93
64
|
|
|
94
65
|
## Commands
|
|
95
66
|
|
|
96
67
|
| Command | Description |
|
|
97
68
|
|---------|-------------|
|
|
98
|
-
| `/soundcloud-setup` |
|
|
69
|
+
| `/soundcloud-setup` | Show setup instructions and config status |
|
|
99
70
|
| `/soundcloud-status` | Show tracking status and account info |
|
|
100
|
-
| `/soundcloud-check` | Run immediate check (
|
|
71
|
+
| `/soundcloud-check` | Run immediate check (verbose output) |
|
|
72
|
+
| `/soundcloud-cron` | Run check for automation (silent if no updates) |
|
|
101
73
|
| `/soundcloud-add <username>` | Track artist(s) - space-separated |
|
|
102
|
-
| `/soundcloud-remove <username>` |
|
|
74
|
+
| `/soundcloud-remove <username>` | Stop tracking an artist |
|
|
103
75
|
| `/soundcloud-list` | List all tracked artists |
|
|
104
76
|
|
|
105
|
-
##
|
|
106
|
-
|
|
107
|
-
All options in `~/.openclaw/openclaw.json` under `plugins.entries.soundcloud-watcher.config`:
|
|
108
|
-
|
|
109
|
-
| Option | Type | Required | Default | Description |
|
|
110
|
-
|--------|------|----------|---------|-------------|
|
|
111
|
-
| `enabled` | boolean | No | true | Enable/disable watcher |
|
|
112
|
-
| `clientId` | string | Yes | - | SoundCloud API Client ID |
|
|
113
|
-
| `clientSecret` | string | Yes | - | SoundCloud API Client Secret |
|
|
114
|
-
| `username` | string | Yes | - | Your SoundCloud username |
|
|
115
|
-
| `checkIntervalHours` | number | No | 6 | Hours between automatic checks |
|
|
116
|
-
| `myTracksLimit` | number | No | 10 | Number of your tracks to monitor |
|
|
117
|
-
| `dormantDays` | number | No | 90 | Days before artist is considered dormant |
|
|
118
|
-
| `sessionKey` | string | No | `agent:main:main` | OpenClaw session for notifications |
|
|
77
|
+
## Automated Checking
|
|
119
78
|
|
|
120
|
-
|
|
79
|
+
The plugin responds to commands but doesn't auto-poll. Set up a cron job for automatic notifications:
|
|
121
80
|
|
|
122
|
-
|
|
81
|
+
```bash
|
|
82
|
+
openclaw cron add --name "soundcloud-check" \
|
|
83
|
+
--every 6h \
|
|
84
|
+
--isolated \
|
|
85
|
+
--message "Run /soundcloud-cron and forward any updates to me on Telegram."
|
|
86
|
+
```
|
|
123
87
|
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
88
|
+
Uses `/soundcloud-cron` which:
|
|
89
|
+
- Returns updates only (silent if nothing new)
|
|
90
|
+
- Logs errors but doesn't spam on config issues
|
|
127
91
|
|
|
128
|
-
|
|
92
|
+
**Alternative:** Add to your `HEARTBEAT.md`:
|
|
93
|
+
```markdown
|
|
94
|
+
- [ ] Run /soundcloud-cron if not checked in last 6 hours
|
|
95
|
+
```
|
|
129
96
|
|
|
130
|
-
|
|
97
|
+
## File Locations
|
|
131
98
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- **Backoff state:** `~/.openclaw/soundcloud_backoff.json`
|
|
99
|
+
| File | Purpose |
|
|
100
|
+
|------|---------|
|
|
101
|
+
| `~/.openclaw/secrets/soundcloud.env` | Your API credentials |
|
|
102
|
+
| `~/.openclaw/data/artists.json` | Tracked artists data |
|
|
103
|
+
| `~/.openclaw/data/soundcloud_tracking.json` | Your account tracking data |
|
|
138
104
|
|
|
139
105
|
## Troubleshooting
|
|
140
106
|
|
|
141
|
-
###
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
openclaw plugins list
|
|
145
|
-
openclaw gateway logs
|
|
146
|
-
```
|
|
107
|
+
### "Not configured" error
|
|
147
108
|
|
|
148
|
-
Check
|
|
149
|
-
- Plugin shows as `enabled: true` in list
|
|
150
|
-
- Gateway logs don't show errors
|
|
109
|
+
Check your credentials file exists and has correct format:
|
|
151
110
|
|
|
152
|
-
Verify plugin directory exists:
|
|
153
111
|
```bash
|
|
154
|
-
|
|
112
|
+
cat ~/.openclaw/secrets/soundcloud.env
|
|
155
113
|
```
|
|
156
114
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
### No notifications
|
|
115
|
+
Should contain:
|
|
116
|
+
```
|
|
117
|
+
SOUNDCLOUD_CLIENT_ID=...
|
|
118
|
+
SOUNDCLOUD_CLIENT_SECRET=...
|
|
119
|
+
MY_USERNAME=...
|
|
120
|
+
```
|
|
165
121
|
|
|
166
|
-
|
|
122
|
+
### Plugin not loading
|
|
167
123
|
|
|
168
|
-
Verify gateway is running:
|
|
169
124
|
```bash
|
|
170
|
-
openclaw
|
|
125
|
+
openclaw plugins list
|
|
171
126
|
```
|
|
172
127
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Run `/soundcloud-setup` for detailed instructions with current config status.
|
|
128
|
+
Should show `soundcloud-watcher` as `loaded`. If `disabled`:
|
|
176
129
|
|
|
177
|
-
## Updating
|
|
178
|
-
|
|
179
|
-
If installed via symlink (`-l`):
|
|
180
130
|
```bash
|
|
181
|
-
|
|
182
|
-
git pull
|
|
131
|
+
openclaw plugins enable soundcloud-watcher
|
|
183
132
|
openclaw gateway restart
|
|
184
133
|
```
|
|
185
134
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
openclaw gateway restart
|
|
190
|
-
```
|
|
135
|
+
### API rate limits
|
|
136
|
+
|
|
137
|
+
The plugin handles rate limits automatically with exponential backoff. If issues persist, wait a few minutes and try again.
|
|
191
138
|
|
|
192
139
|
## Uninstalling
|
|
193
140
|
|
|
194
141
|
```bash
|
|
195
142
|
openclaw plugins disable soundcloud-watcher
|
|
196
|
-
|
|
143
|
+
rm -rf ~/.openclaw/extensions/soundcloud-watcher
|
|
197
144
|
```
|
|
198
145
|
|
|
199
|
-
|
|
146
|
+
Optionally remove data:
|
|
200
147
|
```bash
|
|
201
|
-
rm
|
|
202
|
-
rm
|
|
203
|
-
rm
|
|
204
|
-
rm -rf ~/.openclaw/soundcloud_backoff.json
|
|
148
|
+
rm ~/.openclaw/secrets/soundcloud.env
|
|
149
|
+
rm ~/.openclaw/data/artists.json
|
|
150
|
+
rm ~/.openclaw/data/soundcloud_tracking.json
|
|
205
151
|
```
|
|
206
152
|
|
|
207
|
-
##
|
|
153
|
+
## Links
|
|
208
154
|
|
|
209
155
|
- **GitHub:** https://github.com/wlinds/openclaw-soundcloud-watcher
|
|
210
|
-
- **
|
|
156
|
+
- **npm:** https://www.npmjs.com/package/@akilles/soundcloud-watcher
|
|
211
157
|
- **OpenClaw Docs:** https://docs.openclaw.ai/plugin
|
|
212
158
|
|
|
213
159
|
## License
|
|
214
160
|
|
|
215
|
-
MIT
|
|
161
|
+
MIT
|
package/index.ts
CHANGED
|
@@ -178,5 +178,29 @@ MY_USERNAME=your_soundcloud_username
|
|
|
178
178
|
},
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
+
api.registerCommand({
|
|
182
|
+
name: 'soundcloud-cron',
|
|
183
|
+
description: 'Run check for cron (only outputs if there are updates)',
|
|
184
|
+
handler: async () => {
|
|
185
|
+
const w = getWatcher();
|
|
186
|
+
if (!w) {
|
|
187
|
+
(logger.warn ?? console.warn).call(logger, 'SoundCloud cron: not configured');
|
|
188
|
+
return { text: '' }; // Silent fail for cron
|
|
189
|
+
}
|
|
190
|
+
try {
|
|
191
|
+
const result = await w.runCron();
|
|
192
|
+
if (result) {
|
|
193
|
+
return { text: result };
|
|
194
|
+
}
|
|
195
|
+
// No updates - return empty (silent success)
|
|
196
|
+
(logger.debug ?? console.log).call(logger, 'SoundCloud cron: no updates');
|
|
197
|
+
return { text: '' };
|
|
198
|
+
} catch (e) {
|
|
199
|
+
(logger.error ?? console.error).call(logger, 'SoundCloud cron error:', e);
|
|
200
|
+
return { text: `SoundCloud check failed: ${e}` };
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
});
|
|
204
|
+
|
|
181
205
|
(logger.info ?? console.log).call(logger, 'SoundCloud Watcher plugin loaded');
|
|
182
206
|
}
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
package/soundcloud_watcher.ts
CHANGED
|
@@ -138,6 +138,9 @@ function ensureDir(filepath: string): void {
|
|
|
138
138
|
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// Note: Security scanners may flag this as "file read + network send" (potential exfiltration).
|
|
142
|
+
// This is a false positive — readJson only loads local state files (tracking data, backoff state).
|
|
143
|
+
// The network calls are to the SoundCloud API, not exfiltrating file contents.
|
|
141
144
|
function readJson<T>(filepath: string, fallback: T): T {
|
|
142
145
|
try {
|
|
143
146
|
if (fs.existsSync(filepath)) {
|