Rocksky SDK demos across 10 languages — a tour of the AppView read-query API. docs.rocksky.app/sdks/overview
lastfm scrobbling atproto
0

Configure Feed

Select the types of activity you want to include in your feed.

demos: show loved-songs total (stats.lovedTracks) + sample size (kotlin, ruby)

+9 -3
+6 -2
kotlin/src/main/kotlin/Demo.kt
··· 38 38 // An actor: profile, loved songs, and social graph. 39 39 val profile = av.profile(ACTOR) 40 40 println("\nactor: ${profile.handle ?: ACTOR}") 41 - println(" loved songs: ${av.lovedSongs(ACTOR, 3u, 0u).size}") 41 + 42 + // Totals come from stats; lovedSongs returns a page (here, a 3-item sample). 43 + val stats = av.get("app.rocksky.stats.getStats", mapOf("did" to ACTOR)) 44 + val lovedTotal = Regex("\"lovedTracks\":(\\d+)").find(stats)?.groupValues?.get(1) ?: "?" 45 + val loved = av.lovedSongs(ACTOR, 3u, 0u) 46 + println(" loved songs: $lovedTotal (showing ${loved.size})") 42 47 println(" follows: ${av.follows(ACTOR, 100u, null).size} · followers: ${av.followers(ACTOR, 100u, null).size}") 43 48 44 49 // Universal escape hatch — any read query by nsid returns raw JSON (a string). 45 - val stats = av.get("app.rocksky.stats.getStats", mapOf("did" to ACTOR)) 46 50 println("\nget() escape hatch — stats json: ${stats.take(60)}…") 47 51 48 52 // Identity hash — identical across every Rocksky SDK.
+3 -1
ruby/demo.rb
··· 36 36 puts "\nmatch \"Chaser\" / Calibro 35 -> #{mm["album"]} · #{mm["duration"]}ms · mbId #{mm["mbId"]}" 37 37 38 38 # An actor: profile, loved songs, and social graph — all via get / named reads. 39 + # Totals come from stats; getActorLovedSongs returns a page (here, a 3-item sample). 39 40 profile = Rocksky.profile(ACTOR) 41 + stats = Rocksky.get("app.rocksky.stats.getStats", { did: ACTOR }) 40 42 loved = Rocksky.get("app.rocksky.actor.getActorLovedSongs", { did: ACTOR, limit: 3 })["tracks"] 41 43 follows = Rocksky.get("app.rocksky.graph.getFollows", { actor: ACTOR, limit: 100 })["follows"] 42 44 puts "\nactor: #{profile["handle"] || ACTOR}" 43 - puts " loved songs: #{loved.length}" 45 + puts " loved songs: #{stats["lovedTracks"]} (showing #{loved.length})" 44 46 puts " follows: #{follows.length}" 45 47 46 48 # Identity hash — identical across every Rocksky SDK.