Today we get to learn how to export your data on Bluesky and inspect it. Since Bluesky follows an open standard, all the data on your profile can be compressed pretty heavily.
I first went to https://bsky.app and then hit “download my data”. I got a fairly small (~100 kilobytes) file called repo.car
.
Downloaded from https://docs.bsky.app/blog/repo-export and lightly modified.
go mod init list_car_tool
and go mod tidy
in order to download the necessary repositories.
package main
import (
"context"
"fmt"
"os"
"github.com/bluesky-social/indigo/atproto/syntax"
"github.com/bluesky-social/indigo/repo"
"github.com/ipfs/go-cid"
)
func main() {
ctx := context.Background()
fi, err := os.Open("repo.car")
if err != nil {
panic(err)
}
// read repository tree in to memory
r, err := repo.ReadRepoFromCar(ctx, fi)
if err != nil {
panic(err)
}
// extract DID from repo commit
sc := r.SignedCommit()
did, err := syntax.ParseDID(sc.Did)
if err != nil {
panic(err)
}
fmt.Printf("%s\n", did)
// iterate over all of the records by key and CID
err = r.ForEach(ctx, "", func(k string, v cid.Cid) error {
fmt.Printf("%s\t%s\n", k, v.String())
return nil
})
if err != nil {
panic(err)
}
}
Note that my DID for Bluesky is the following:
~/s/car$ dig +short _atproto.aidenfoxivey.com TXT
"did=did:plc:jghfpstu6aoqw3rtklzbaupt"
We can look this up because I use my custom domain aidenfoxivey.com as my username on Bluesky.
Let’s now run the code:
~/s/car$ go run list_car.go
did:plc:jghfpstu6aoqw3rtklzbaupt
app.bsky.actor.profile/self bafyreibcwafkwnkwzoxcuhjrirnkpwje4eiicaaxfwd7kfnozdu7ix5pj4
app.bsky.feed.like/3lka4whgjkf2b bafyreifh2vslm73t6xjcn4tuo3uqltltx2npffknes4b6u7lcymiccumvi
... snipped for brevity ...
app.bsky.graph.listitem/3lnb67l3m4n2s bafyreibr7ydj45bmyrj6o64uvajl6oeyna3ihvefdoqkn4uknk55r3qh4m
sh.tangled.graph.follow/3lkmqtidl4q22 bafyreicqrvo5b333266ng7e5kzzrxxailqahydsvzeqatyl55zj2oz4oqy
sh.tangled.graph.follow/3lnlxutiq5g22 bafyreiecfshx52g5eqah6zx6yc7xqqblhdegpxqqrg7oxj4zq563mk52g4
sh.tangled.publicKey/3lobv2tc4bk22 bafyreiap6pfohez3xo2dvp4xrj3q2ydjufkhcookh4dwibmmd5xxf7osb4
sh.tangled.repo/3lobuzrvqg422 bafyreihbkfwzh4mmjljgp4xjs7h3ktcdnk4fkrenz3mst42aos7bpcgt3y
Note at the bottom that I was fooling around with a service called tangled.sh, which is a Git service that has its discoverability powered by ATProto.
Here’s tangled.sh on the front page of git-scm.org! The only one here I’ve not tried now is radicle, which has always struck me as pretty cool. I must admit that I’m a bit of a bandwagon-er when it comes to trying new systems.