Files
ContentGen_BE/test-curl-tweet.sh
Harun CAN 9486f86cca
Some checks failed
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-04-05 20:37:15 +03:00

20 lines
629 B
Bash
Executable File

#!/bin/bash
LOGIN_RES=$(curl -s -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"admin@contentgen.ai","password":"Admin123!"}')
TOKEN=$(echo $LOGIN_RES | grep -o '"accessToken":"[^"]*' | cut -d'"' -f4)
if [ -z "$TOKEN" ]; then
echo "Login failed!"
exit 1
fi
echo "Creating from tweet..."
curl -s -X POST http://localhost:3000/api/projects/from-tweet \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-d '{"tweetUrl":"https://x.com/NightSkyNow/status/1888497676747206744"}' > tweet_res.json
echo "Raw Tweet Response:"
cat tweet_res.json