fix
This commit is contained in:
50
install.zsh
50
install.zsh
@@ -422,6 +422,56 @@ function at-repos-feed-generator-start-push() {
|
|||||||
npx tsx scripts/publish.ts
|
npx tsx scripts/publish.ts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function at-repos-feed-generator-update() {
|
||||||
|
|
||||||
|
resp=$(curl -sL -X POST -H "Content-Type: application/json" -d "{\"identifier\":\"$handle\",\"password\":\"${APP_PASSWORD}\"}" https://${host}/xrpc/com.atproto.server.createSession)
|
||||||
|
token=$(echo $resp | jq -r .accessJwt)
|
||||||
|
if [ -z "$token" ] || [ "$token" == "null" ]; then
|
||||||
|
echo "Login failed: $resp"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
avatar_json="{\"\$type\":\"blob\",\"ref\":{\"\$link\":\"${img_id}\"},\"mimeType\":\"image/jpeg\",\"size\":375259}"
|
||||||
|
|
||||||
|
# 3. Delete cmd record
|
||||||
|
#curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" \
|
||||||
|
# -d "{\"repo\":\"$handle\",\"collection\":\"app.bsky.feed.generator\",\"rkey\":\"cmd\"}" \
|
||||||
|
# https://${host}/xrpc/com.atproto.repo.deleteRecord
|
||||||
|
|
||||||
|
# 4. Put app record
|
||||||
|
echo "Creating app record..."
|
||||||
|
now=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
|
||||||
|
# Create JSON payload
|
||||||
|
# Note: feeding avatar_json directly into jq
|
||||||
|
payload=$(jq -n \
|
||||||
|
--arg repo "$handle" \
|
||||||
|
--arg collection "app.bsky.feed.generator" \
|
||||||
|
--arg rkey "app" \
|
||||||
|
--arg did "did:web:feed.${host}" \
|
||||||
|
--arg type "app.bsky.feed.generator" \
|
||||||
|
--arg created "$now" \
|
||||||
|
--arg display "App Feed" \
|
||||||
|
--arg desc "Automated App Feed" \
|
||||||
|
--argjson avatar "$avatar_json" \
|
||||||
|
'{
|
||||||
|
repo: $repo,
|
||||||
|
collection: $collection,
|
||||||
|
rkey: $rkey,
|
||||||
|
record: {
|
||||||
|
did: $did,
|
||||||
|
"$type": $type,
|
||||||
|
createdAt: $created,
|
||||||
|
displayName: $display,
|
||||||
|
description: $desc,
|
||||||
|
avatar: $avatar
|
||||||
|
}
|
||||||
|
}')
|
||||||
|
curl -sL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $token" \
|
||||||
|
-d @- \
|
||||||
|
https://${host}/xrpc/com.atproto.repo.putRecord
|
||||||
|
}
|
||||||
|
|
||||||
at-repos-env
|
at-repos-env
|
||||||
case "$1" in
|
case "$1" in
|
||||||
pull)
|
pull)
|
||||||
|
|||||||
Reference in New Issue
Block a user