-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathdebug-parse.js
More file actions
36 lines (30 loc) · 1.07 KB
/
Copy pathdebug-parse.js
File metadata and controls
36 lines (30 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const axios = require('axios');
const REGISTRY_URL = 'https://raw.githubusercontent.com/VoltAgent/awesome-moltbot-skills/main/README.md';
async function testParse() {
console.log('Fetching...');
const response = await axios.get(REGISTRY_URL);
const markdown = response.data;
const lines = markdown.split('\n');
console.log('Total lines:', lines.length);
let matchCount = 0;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
// Test header regex
const headerMatch = line.match(/^(#{2,3})\s+(.*)/);
if (headerMatch) {
console.log(`Line ${i} HEADER match: ${headerMatch[2]}`);
}
// Test skill regex
const skillMatch = line.match(/^\s*-\s*\[(.*?)\]\((.*?)\)\s*-\s*(.*)/);
if (skillMatch) {
matchCount++;
if (matchCount < 5) {
console.log(`Line ${i} SKILL match: ${skillMatch[1]}`);
}
}
if (i > 100 && matchCount === 0) {
console.log(`Line ${i} sample: ${line}`);
}
}
}
testParse();