154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
|
# File 'lib/heathrow/sources/source_manager.rb', line 154
def get_source_types
{
'gmail' => {
name: 'Gmail (OAuth2)',
description: 'Connect to Gmail using OAuth2 (requires setup - see fields below)',
icon: '✉',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'email', label: 'Gmail Address', type: 'text', required: true, placeholder: '[email protected]' },
{ key: 'safedir', label: 'Safe Directory', type: 'text', required: true, default: File.join(Dir.home, '.heathrow', 'mail'),
help: 'Dir with OAuth files: email.json (credentials) & email.txt (refresh token)' },
{ key: 'oauth2_script', label: 'OAuth2 Script', type: 'text', default: '~/bin/oauth2.py',
help: 'Get from: github.com/google/gmail-oauth2-tools/blob/master/python/oauth2.py' },
{ key: 'folder', label: 'Folder', type: 'text', default: 'INBOX' },
{ key: 'fetch_limit', label: 'Max messages per fetch', type: 'number', default: 50 },
{ key: 'mark_as_read', label: 'Mark as read (CAUTION)', type: 'boolean', default: false },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 300 }
]
},
'imap' => {
name: 'Email (IMAP)',
description: 'Connect to any IMAP email server with username/password',
icon: '📧',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'imap_server', label: 'IMAP Server', type: 'text', required: true, placeholder: 'imap.example.com' },
{ key: 'imap_port', label: 'IMAP Port', type: 'number', default: 993 },
{ key: 'username', label: 'Username/Email', type: 'text', required: true },
{ key: 'password', label: 'Password', type: 'password', required: true },
{ key: 'use_ssl', label: 'Use SSL/TLS', type: 'boolean', default: true },
{ key: 'folder', label: 'Folder', type: 'text', default: 'INBOX' },
{ key: 'fetch_limit', label: 'Max messages per fetch', type: 'number', default: 50 },
{ key: 'mark_as_read', label: 'Mark fetched as read', type: 'boolean', default: false },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 300 }
]
},
'whatsapp' => {
name: 'WhatsApp',
description: 'Connect via WhatsApp Web (requires API server)',
icon: '◉',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'api_url', label: 'WhatsApp API URL', type: 'text', default: 'http://localhost:8080',
help: 'URL of the WhatsApp API server (whatsmeow)' },
{ key: 'use_pairing_code', label: 'Use pairing code instead of QR?', type: 'boolean', default: false,
help: 'Use 8-digit pairing code instead of QR code scanning' },
{ key: 'phone_number', label: 'Phone Number (for pairing code)', type: 'text', placeholder: '1234567890',
help: 'Required only if using pairing code method' },
{ key: 'fetch_limit', label: 'Messages per fetch', type: 'number', default: 50 },
{ key: 'incremental_sync', label: 'Incremental sync', type: 'boolean', default: true,
help: 'Only fetch new messages since last sync' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 60 }
]
},
'telegram' => {
name: 'Telegram',
description: 'Connect to Telegram via Bot or User account',
icon: '✈',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'bot_token', label: 'Bot Token (if using bot)', type: 'password', required: false,
help: 'Get from @BotFather in Telegram. Leave empty for user account.' },
{ key: 'api_id', label: 'API ID (if using user account)', type: 'text', required: false,
help: 'Get from https://my.telegram.org - only for user account' },
{ key: 'api_hash', label: 'API Hash (if using user account)', type: 'password', required: false,
help: 'Get from https://my.telegram.org - only for user account' },
{ key: 'phone_number', label: 'Phone Number (if using user account)', type: 'text', required: false,
placeholder: '+1234567890', help: 'Required for user account authentication' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 60 }
]
},
'discord' => {
name: 'Discord',
description: 'Connect to Discord servers and channels',
icon: '💬',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'token', label: 'Bot Token', type: 'password', required: true,
help: 'Bot token from Discord Developer Portal (starts with MTM...)' },
{ key: 'is_bot', label: 'Is Bot Token?', type: 'boolean', default: true,
help: 'Set to true for bot tokens, false for user tokens (not recommended)' },
{ key: 'channels', label: 'Channel IDs', type: 'text', placeholder: '1234567890,0987654321',
help: 'Comma-separated Discord channel IDs to monitor' },
{ key: 'guilds', label: 'Guild/Server IDs', type: 'text', placeholder: 'Optional',
help: 'Monitor all channels in these guilds (comma-separated)' },
{ key: 'fetch_limit', label: 'Messages per fetch', type: 'number', default: 20 },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 60 }
]
},
'reddit' => {
name: 'Reddit',
description: 'Monitor subreddits and messages',
icon: '®',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true },
{ key: 'client_id', label: 'Client ID', type: 'text', required: true },
{ key: 'client_secret', label: 'Client Secret', type: 'password', required: true },
{ key: 'user_agent', label: 'User Agent', type: 'text', required: true, default: 'Heathrow/1.0' },
{ key: 'username', label: 'Username (optional)', type: 'text' },
{ key: 'password', label: 'Password (optional)', type: 'password' },
{ key: 'subreddits', label: 'Subreddits to monitor', type: 'text', placeholder: 'AskReddit,news,technology' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 300 }
]
},
'rss' => {
name: 'RSS/Atom Feeds',
description: 'Subscribe to RSS and Atom feeds',
icon: '◈',
fields: [
{ key: 'name', label: 'Feed Collection Name', type: 'text', required: true },
{ key: 'feeds', label: 'Feed URLs (one per line)', type: 'multiline', required: true, placeholder: "https://news.ycombinator.com/rss\nhttps://example.com/feed.xml" },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 900 }
]
},
'web' => {
name: 'Web Page Monitor',
description: 'Monitor web pages for changes (use setup_webwatch.rb to configure)',
icon: '◎',
fields: [
{ key: 'name', label: 'Collection Name', type: 'text', required: true },
{ key: 'pages', label: 'Pages (JSON array)', type: 'multiline', required: true,
placeholder: '[{"url": "https://example.com", "title": "Example", "selector": "#content"}]' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 3600 }
]
},
'messenger' => {
name: 'Facebook Messenger',
description: 'Read Messenger DMs via browser cookies (no app needed)',
icon: '◉',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true, default: 'Messenger' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 300 }
]
},
'instagram' => {
name: 'Instagram DMs',
description: 'Read Instagram direct messages via browser cookies (no app needed)',
icon: '◈',
fields: [
{ key: 'name', label: 'Account Name', type: 'text', required: true, default: 'Instagram' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 300 }
]
},
'slack' => {
name: 'Slack',
description: 'Connect to Slack workspaces',
icon: '#',
fields: [
{ key: 'name', label: 'Workspace Name', type: 'text', required: true },
{ key: 'token', label: 'Bot/User Token', type: 'password', required: true, placeholder: 'xoxb-...' },
{ key: 'channels', label: 'Channel IDs (optional)', type: 'text', placeholder: 'C1234567890,C0987654321' },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 60 }
]
},
'weechat' => {
name: 'WeeChat Relay',
description: 'Connect to WeeChat relay for IRC, Slack, and other buffers',
icon: 'W',
fields: [
{ key: 'name', label: 'Source Name', type: 'text', required: true, default: 'WeeChat' },
{ key: 'host', label: 'Relay Host', type: 'text', required: true, default: 'localhost',
help: 'Host running WeeChat relay (use SSH tunnel for remote)' },
{ key: 'port', label: 'Relay Port', type: 'number', required: true, default: 8001 },
{ key: 'password', label: 'Relay Password', type: 'password', required: true },
{ key: 'buffer_filter', label: 'Buffer Filter', type: 'text',
help: 'Comma-separated patterns, e.g.: irc.*,python.slack.* (empty = all)' },
{ key: 'lines_per_buffer', label: 'Lines per buffer', type: 'number', default: 30 },
{ key: 'polling_interval', label: 'Check interval (seconds)', type: 'number', default: 120 }
]
},
}
end
|