this repo has no description

feat: move to new Jetstream fields

Changed files
+6 -4
pkg
mostliked
+1 -1
go.mod
···
require (
github.com/bluesky-social/indigo v0.0.0-20240905024844-a4f38639767f
-
github.com/bluesky-social/jetstream v0.0.0-20240925210745-2cd1b6147279
+
github.com/bluesky-social/jetstream v0.0.0-20241020000921-dcd43344c716
github.com/gorilla/websocket v1.5.3
github.com/karlseguin/ccache/v3 v3.0.5
github.com/labstack/echo/v4 v4.11.3
+2
go.sum
···
github.com/bluesky-social/indigo v0.0.0-20240905024844-a4f38639767f/go.mod h1:Zx9nSWgd/FxMenkJW07VKnzspxpHBdPrPmS+Fspl2I0=
github.com/bluesky-social/jetstream v0.0.0-20240925210745-2cd1b6147279 h1:45wwXL1io7pAcgqFMBHFi2GdF4CRg0/4Sq65JY3PfkM=
github.com/bluesky-social/jetstream v0.0.0-20240925210745-2cd1b6147279/go.mod h1:/GMZrwKMbAiWU2MVCswH8+Jd3ybrpkHX4qM6tTfyv1k=
+
github.com/bluesky-social/jetstream v0.0.0-20241020000921-dcd43344c716 h1:I8+VaZKaNIGCPGXE2/VXzJGlPFEZgiFLjnge+OWFl5w=
+
github.com/bluesky-social/jetstream v0.0.0-20241020000921-dcd43344c716/go.mod h1:/dE2dmFell/m4zxgIbH3fkiqZ1obzr/ETj4RpgomgMs=
github.com/carlmjohnson/versioninfo v0.22.5 h1:O00sjOLUAFxYQjlN/bzYTuZiS0y6fWDQjMRvwtKgwwc=
github.com/carlmjohnson/versioninfo v0.22.5/go.mod h1:QT9mph3wcVfISUKd0i9sZfVrPviHuSF+cUtLjm2WSf8=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+3 -3
pkg/mostliked/handler.go
···
if err := json.Unmarshal(evt, &event); err != nil {
continue
}
-
if event.Commit == nil {
+
if event.Kind != jetstream.EventKindCommit {
continue
}
-
commit := *event.Commit
-
if commit.OpType != "c" {
+
if event.Commit.Operation != jetstream.CommitOperationCreate {
continue
}
+
commit := *event.Commit
if commit.Collection == "app.bsky.feed.post" {
var post appbsky.FeedPost
postUri := fmt.Sprintf("at://%s/%s/%s", event.Did, commit.Collection, commit.RKey)