- Add twitter-reader v1.0.0 for Twitter/X content fetching via Jina.ai API - Implement secure API key management using environment variables - Support individual and batch tweet fetching with bundled scripts - Include Python (fetch_tweet.py) and Bash (fetch_tweets.sh) scripts - Update marketplace to v1.20.0 (26 → 27 skills) - Update all documentation (README.md, README.zh-CN.md, CLAUDE.md) - Security: Remove hardcoded API keys, enforce HTTPS, add validation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
32 lines
862 B
Bash
Executable File
32 lines
862 B
Bash
Executable File
#!/bin/bash
|
|
# Fetch Twitter/X post content using jina.ai API
|
|
# Usage: ./fetch_tweets.sh <url1> [url2] ...
|
|
# Requires: JINA_API_KEY environment variable
|
|
|
|
if [ -z "$JINA_API_KEY" ]; then
|
|
echo "Error: JINA_API_KEY environment variable is not set" >&2
|
|
echo "Get your API key from https://jina.ai/ and set:" >&2
|
|
echo " export JINA_API_KEY='your_api_key_here'" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ $# -eq 0 ]; then
|
|
echo "Usage: $0 <tweet_url> [tweet_url2] ..."
|
|
echo "Example: $0 https://x.com/dabit3/status/2009131298250428923"
|
|
exit 1
|
|
fi
|
|
|
|
for url in "$@"; do
|
|
if [[ ! "$url" =~ ^https?://(x\.com|twitter\.com)/ ]]; then
|
|
echo "Skipping invalid URL: $url" >&2
|
|
continue
|
|
fi
|
|
|
|
echo "Fetching: $url"
|
|
curl -s "https://r.jina.ai/${url}" \
|
|
-H "Authorization: Bearer ${JINA_API_KEY}"
|
|
echo ""
|
|
echo "---"
|
|
echo ""
|
|
done
|