fspkwon

bsky_facet_app

Oct 24th, 2025 (edited)
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. facet: XXXX-XXXX-XXXX-XXXX
  2.  
  3. we have our JSON File:
  4. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  5. {
  6. "$type": "app.bsky.feed.post",
  7. "text": "This is my general Post: link",
  8. "createdAt": "2025-10-24T15:00:00.000Z",
  9. "facets": [
  10. {
  11. "$type": "app.bsky.richtext.facet",
  12. "index": { "byteStart": 25, "byteEnd": 29 },
  13. "features": [
  14. {
  15. "$type": "app.bsky.richtext.facet#link",
  16. "uri": "http://google.com"
  17. }
  18. ]
  19. }
  20. ]
  21. }
  22. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  23. our curl cmdline:
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. curl -s -X POST https://bsky.social/xrpc/com.atproto.server.createSession \
  26. -H "Content-Type: application/json" \
  27. -d '{"identifier":"XXXXXXX.bsky.social","password":"XXXX-XXXX-XXXX-XXXX"}' > access.jwt
  28. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  29. we need the response token as: $ACCESS_JWT
  30. so make extract the token:
  31. cat access.jwt | jq -r '.accessJwt' > access.token
  32. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  33. and respond to it:
  34. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  35. curl -s -X POST https://bsky.social/xrpc/com.atproto.repo.createRecord \
  36. -H "Authorization: Bearer $(cat access.token)" \
  37. -H "Content-Type: application/json" \
  38. -d "{
  39. \"repo\": \"fspkwon.bsky.social\",
  40. \"collection\": \"app.bsky.feed.post\",
  41. \"record\": {
  42. \"\$type\": \"app.bsky.feed.post\",
  43. \"text\": \"This is my general Post: link\",
  44. \"createdAt\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",
  45. \"facets\": [
  46. {
  47. \"\$type\": \"app.bsky.richtext.facet\",
  48. \"index\": { \"byteStart\": 25, \"byteEnd\": 29 },
  49. \"features\": [
  50. { \"\$type\": \"app.bsky.richtext.facet#link\", \"uri\": \"http://google.com\" }
  51. ]
  52. }
  53. ]
  54. }
  55. }"
  56. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  57.  
Add Comment
Please, Sign In to add comment