Skip to content

Commit df5c904

Browse files
StartAutomatingStartAutomating
StartAutomating
authored and
StartAutomating
committed
feat: Get-WebSocket -WatchFor ( Fixes #29 )
1 parent a8ae39b commit df5c904

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

docs/_data/Help/Get-WebSocket.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"Synopsis": "WebSockets in PowerShell.",
3-
"Description": "Get-WebSocket gets a websocket.\n\nThis will create a job that connects to a WebSocket and outputs the results.\n\nIf the `-Watch` parameter is provided, will output a continous stream of objects from the websocket.",
3+
"Description": "Get-WebSocket gets a websocket.\n\nThis will create a job that connects to a WebSocket and outputs the results.\n\nIf the `-Watch` parameter is provided, will output a continous stream of objects.",
44
"Parameters": [
55
{
66
"Name": null,
@@ -64,6 +64,21 @@
6464
"Title": "EXAMPLE 7",
6565
"Markdown": "",
6666
"Code": "websocket wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -Watch |\n Where-Object {\n $_.commit.record.embed.'$type' -eq 'app.bsky.embed.external'\n } |\n Foreach-Object {\n $_.commit.record.embed.external.uri\n }"
67+
},
68+
{
69+
"Title": "EXAMPLE 8",
70+
"Markdown": "BlueSky, but just the hashtags",
71+
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{\n {$webSocketoutput.commit.record.text -match \"\\#\\w+\"}={\n $matches.0\n } \n}"
72+
},
73+
{
74+
"Title": "EXAMPLE 9",
75+
"Markdown": "BlueSky, but just the hashtags (as links)",
76+
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{\n {$webSocketoutput.commit.record.text -match \"\\#\\w+\"}={\n if ($psStyle.FormatHyperlink) {\n $psStyle.FormatHyperlink($matches.0, \"https://bsky.app/search?q=$([Web.HttpUtility]::UrlEncode($matches.0))\")\n } else {\n $matches.0\n }\n }\n}"
77+
},
78+
{
79+
"Title": "EXAMPLE 10",
80+
"Markdown": "",
81+
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -WatchFor @{\n {$args.commit.record.text -match \"\\#\\w+\"}={\n $matches.0\n }\n {$args.commit.record.text -match '[\\p{IsHighSurrogates}\\p{IsLowSurrogates}]+'}={\n $matches.0\n }\n}"
6782
}
6883
]
6984
}

0 commit comments

Comments
 (0)