Skip to content

Commit 9734a05

Browse files
StartAutomatingStartAutomating
authored andcommitted
feat: Get-WebSocket -WatchFor ( Fixes #29 )
1 parent 917fa5b commit 9734a05

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,4 +113,40 @@ websocket wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.
113113
$_.commit.record.embed.external.uri
114114
}
115115
~~~
116+
#### Get-WebSocket Example 8
117+
118+
~~~powershell
119+
# BlueSky, but just the hashtags
120+
websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{
121+
{$webSocketoutput.commit.record.text -match "\#\w+"}={
122+
$matches.0
123+
}
124+
}
125+
~~~
126+
#### Get-WebSocket Example 9
127+
128+
~~~powershell
129+
# BlueSky, but just the hashtags (as links)
130+
websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{
131+
{$webSocketoutput.commit.record.text -match "\#\w+"}={
132+
if ($psStyle.FormatHyperlink) {
133+
$psStyle.FormatHyperlink($matches.0, "https://bsky.app/search?q=$([Web.HttpUtility]::UrlEncode($matches.0))")
134+
} else {
135+
$matches.0
136+
}
137+
}
138+
}
139+
~~~
140+
#### Get-WebSocket Example 10
141+
142+
~~~powershell
143+
websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{
144+
{$args.commit.record.text -match "\#\w+"}={
145+
$matches.0
146+
}
147+
{$args.commit.record.text -match '[\p{IsHighSurrogates}\p{IsLowSurrogates}]+'}={
148+
$matches.0
149+
}
150+
}
151+
~~~
116152

0 commit comments

Comments
 (0)