fix: correct hardcoded folder paths to use underscores
- Fix transcript-extract.sh: `00 Inbox/Clippings` → `00_Inbox/Clippings/` - Fix firecrawl-batch.sh: `00 Inbox/Clippings` → `00_Inbox/Clippings/` - Add `-o|--output-dir` flag to firecrawl-batch.sh for custom paths - Fix update-attachment-links.js: `05 Attachments` → `05_Attachments` - Fix fix-renamed-links.js: `05 Attachments` → `05_Attachments` - Fix GEMINI_VISION_QUICK_START.md example paths - Update README.md with new flag documentation All folder paths now match actual repo structure (underscores not spaces). This prevents scripts from failing due to incorrect directory references. Fixes #9 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -30,8 +30,13 @@ Scrapes multiple URLs and auto-generates filenames.
|
||||
|
||||
```bash
|
||||
# Requires FIRECRAWL_API_KEY environment variable
|
||||
|
||||
# Basic usage - saves to 00_Inbox/Clippings/
|
||||
.scripts/firecrawl-batch.sh <url1> <url2> <url3>
|
||||
# Files saved to 00_Inbox/Clippings/
|
||||
|
||||
# Custom output directory
|
||||
.scripts/firecrawl-batch.sh -o 01_Projects/Research/ <url1> <url2>
|
||||
.scripts/firecrawl-batch.sh --output-dir 03_Resources/Articles/ <url1> <url2>
|
||||
```
|
||||
|
||||
### Transcript Extraction
|
||||
@@ -41,7 +46,11 @@ Scrapes multiple URLs and auto-generates filenames.
|
||||
Extracts transcripts from YouTube videos.
|
||||
|
||||
```bash
|
||||
# Basic usage - saves to 00_Inbox/Clippings/
|
||||
.scripts/transcript-extract.sh <youtube-url>
|
||||
|
||||
# Custom output directory
|
||||
.scripts/transcript-extract.sh <youtube-url> 01_Projects/Research/
|
||||
```
|
||||
|
||||
## NPM Scripts
|
||||
|
||||
@@ -1,16 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Firecrawl batch scraper script
|
||||
# Usage: ./firecrawl-batch.sh <url1> <url2> ...
|
||||
# Usage: ./firecrawl-batch.sh [-o|--output-dir <dir>] <url1> <url2> ...
|
||||
# Automatically generates filenames based on page titles and dates
|
||||
# Requires: FIRECRAWL_API_KEY environment variable
|
||||
|
||||
# Source .zshrc to get the API key
|
||||
source ~/.zshrc
|
||||
# Default output directory
|
||||
OUTPUT_DIR="00_Inbox/Clippings/"
|
||||
URLS=()
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Usage: $0 <url1> <url2> ..."
|
||||
echo "Scrapes multiple URLs and saves them to 00 Inbox/Clippings/"
|
||||
# Parse arguments
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-o|--output-dir)
|
||||
OUTPUT_DIR="$2"
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
URLS+=("$1")
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ${#URLS[@]} -eq 0 ]; then
|
||||
echo "Usage: $0 [-o|--output-dir <dir>] <url1> <url2> ..."
|
||||
echo "Default output directory: 00_Inbox/Clippings/"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -o, --output-dir <dir> Specify custom output directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -21,7 +39,7 @@ fi
|
||||
|
||||
# Get today's date
|
||||
TODAY=$(date +"%Y-%m-%d")
|
||||
CLIPPINGS_DIR="00 Inbox/Clippings"
|
||||
CLIPPINGS_DIR="$OUTPUT_DIR"
|
||||
|
||||
# Create clippings directory if it doesn't exist
|
||||
mkdir -p "$CLIPPINGS_DIR"
|
||||
@@ -41,7 +59,7 @@ SUCCESS_COUNT=0
|
||||
FAIL_COUNT=0
|
||||
|
||||
# Process each URL
|
||||
for URL in "$@"; do
|
||||
for URL in "${URLS[@]}"; do
|
||||
echo "Processing: $URL"
|
||||
|
||||
# Make the API call and save to temp file
|
||||
|
||||
@@ -23,7 +23,7 @@ if (args.length !== 2) {
|
||||
}
|
||||
|
||||
const [oldName, newName] = args
|
||||
const newPath = `05 Attachments/Organized/${newName}`
|
||||
const newPath = `05_Attachments/Organized/${newName}`
|
||||
|
||||
console.log(`Fixing links: ${oldName} → ${newName}`)
|
||||
|
||||
@@ -59,9 +59,9 @@ walkDir('.', (filepath) => {
|
||||
const pattern1 = new RegExp(`!\\[\\[${escapedOld}\\]\\]`, 'g')
|
||||
content = content.replace(pattern1, `![[${newPath}]]`)
|
||||
|
||||
// Pattern 2: ![[05 Attachments/oldname]]
|
||||
// Pattern 2: ![[05_Attachments/oldname]]
|
||||
const pattern2 = new RegExp(
|
||||
`!\\[\\[05 Attachments/${escapedOld}\\]\\]`,
|
||||
`!\\[\\[05_Attachments/${escapedOld}\\]\\]`,
|
||||
'g',
|
||||
)
|
||||
content = content.replace(pattern2, `![[${newPath}]]`)
|
||||
@@ -70,9 +70,9 @@ walkDir('.', (filepath) => {
|
||||
const pattern3 = new RegExp(`(?<!!)\\[\\[${escapedOld}\\]\\]`, 'g')
|
||||
content = content.replace(pattern3, `[[${newPath}]]`)
|
||||
|
||||
// Pattern 4: [[05 Attachments/oldname]] without !
|
||||
// Pattern 4: [[05_Attachments/oldname]] without !
|
||||
const pattern4 = new RegExp(
|
||||
`(?<!!)\\[\\[05 Attachments/${escapedOld}\\]\\]`,
|
||||
`(?<!!)\\[\\[05_Attachments/${escapedOld}\\]\\]`,
|
||||
'g',
|
||||
)
|
||||
content = content.replace(pattern4, `[[${newPath}]]`)
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
|
||||
# Transcript extraction script for YouTube videos
|
||||
# Usage: .scripts/transcript-extract.sh <youtube-url> [output-path]
|
||||
# Default output: 00 Inbox/Clippings/
|
||||
# Default output: 00_Inbox/Clippings/
|
||||
|
||||
set -e
|
||||
|
||||
URL="$1"
|
||||
OUTPUT_PATH="${2:-00 Inbox/Clippings}"
|
||||
OUTPUT_PATH="${2:-00_Inbox/Clippings/}"
|
||||
|
||||
if [ -z "$URL" ]; then
|
||||
echo "Usage: $0 <youtube-url> [output-path]"
|
||||
echo "Default output path: 00 Inbox/Clippings/"
|
||||
echo "Default output path: 00_Inbox/Clippings/"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import fs from 'node:fs'
|
||||
import path from 'node:path'
|
||||
|
||||
const organizedDir = '05 Attachments/Organized'
|
||||
const organizedDir = '05_Attachments/Organized'
|
||||
const args = process.argv.slice(2)
|
||||
const specificFile = args[0]
|
||||
|
||||
@@ -69,24 +69,24 @@ walkDir('.', (filepath) => {
|
||||
const pattern1 = new RegExp(`!\\[\\[${escapedFile}\\]\\]`, 'g')
|
||||
content = content.replace(
|
||||
pattern1,
|
||||
`![[05 Attachments/Organized/${filename}]]`,
|
||||
`![[05_Attachments/Organized/${filename}]]`,
|
||||
)
|
||||
|
||||
// Pattern 2: ![[05 Attachments/filename]] (file in root being moved)
|
||||
// Pattern 2: ![[05_Attachments/filename]] (file in root being moved)
|
||||
const pattern2 = new RegExp(
|
||||
`!\\[\\[05 Attachments/${escapedFile}\\]\\]`,
|
||||
`!\\[\\[05_Attachments/${escapedFile}\\]\\]`,
|
||||
'g',
|
||||
)
|
||||
content = content.replace(
|
||||
pattern2,
|
||||
`![[05 Attachments/Organized/${filename}]]`,
|
||||
`![[05_Attachments/Organized/${filename}]]`,
|
||||
)
|
||||
|
||||
// Pattern 3: [[filename]] without ! (for PDFs and other non-embedded links)
|
||||
// Only if not already pointing to Organized
|
||||
const pattern3 = new RegExp(`\\[\\[${escapedFile}\\]\\]`, 'g')
|
||||
const pattern3Organized = new RegExp(
|
||||
`\\[\\[05 Attachments/Organized/${escapedFile}\\]\\]`,
|
||||
`\\[\\[05_Attachments/Organized/${escapedFile}\\]\\]`,
|
||||
'g',
|
||||
)
|
||||
|
||||
@@ -94,18 +94,18 @@ walkDir('.', (filepath) => {
|
||||
if (!pattern3Organized.test(content)) {
|
||||
content = content.replace(
|
||||
pattern3,
|
||||
`[[05 Attachments/Organized/${filename}]]`,
|
||||
`[[05_Attachments/Organized/${filename}]]`,
|
||||
)
|
||||
}
|
||||
|
||||
// Pattern 4: [[05 Attachments/filename]] without !
|
||||
// Pattern 4: [[05_Attachments/filename]] without !
|
||||
const pattern4 = new RegExp(
|
||||
`\\[\\[05 Attachments/${escapedFile}\\]\\]`,
|
||||
`\\[\\[05_Attachments/${escapedFile}\\]\\]`,
|
||||
'g',
|
||||
)
|
||||
content = content.replace(
|
||||
pattern4,
|
||||
`[[05 Attachments/Organized/${filename}]]`,
|
||||
`[[05_Attachments/Organized/${filename}]]`,
|
||||
)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user