-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-cron.sh
More file actions
executable file
Β·32 lines (25 loc) Β· 955 Bytes
/
Copy pathtest-cron.sh
File metadata and controls
executable file
Β·32 lines (25 loc) Β· 955 Bytes
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
#!/bin/bash
# Test script for debugging the cron functionality
# Usage: ./test-cron.sh
echo "π§ͺ Testing Twitter Bot Cron Functionality"
echo "=========================================="
# Check if CRON_SECRET is set
if [ -z "$CRON_SECRET" ]; then
echo "β CRON_SECRET environment variable is not set"
echo "Please set it with: export CRON_SECRET='your-secret-here'"
exit 1
fi
echo "β
CRON_SECRET is set"
echo "π Current UTC time: $(date -u)"
# Test the schedule endpoint
echo ""
echo "π
Testing schedule endpoint..."
schedule_response=$(curl -s "https://vin-wallpaper.vercel.app/api/schedule?secret=$CRON_SECRET")
echo "Schedule Response: $schedule_response"
# Test the auto-post endpoint
echo ""
echo "π€ Testing auto-post endpoint..."
auto_post_response=$(curl -s "https://vin-wallpaper.vercel.app/api/cron/auto-post?secret=$CRON_SECRET")
echo "Auto-post Response: $auto_post_response"
echo ""
echo "β
Test completed!"