File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,25 @@ websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.
118118 }
119119}
120120```
121+ We can decorate a type returned from a WebSocket, allowing us to add additional properties.
122+ For example, let's add a ` Tags ` property to the ` app.bsky.feed.post ` type.
123+
124+ ``` PowerShell
125+ $typeName = 'app.bsky.feed.post'
126+ Update-TypeData -TypeName $typeName -MemberName 'Tags' -MemberType ScriptProperty -Value {
127+ @($this.commit.record.facets.features.tag)
128+ } -Force
129+
130+ # Now, let's get 10kb posts ( this should not take too long )
131+ $somePosts =
132+ websocket "wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=$typeName" -PSTypeName $typeName -Maximum 10kb -Watch
133+ $somePosts |
134+ ? Tags |
135+ Select -ExpandProperty Tags |
136+ Group |
137+ Sort Count -Descending |
138+ Select -First 10
139+ ```
121140
122141---
123142
You can’t perform that action at this time.
0 commit comments