Skip to content

Commit 268ee36

Browse files
StartAutomatingStartAutomating
authored andcommitted
fix: Adding WebSocket pseudotypes ( Fixes #92, Fixes #93 )
1 parent ff02077 commit 268ee36

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/_data/Help/Get-WebSocket.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,32 +37,32 @@
3737
{
3838
"Title": "EXAMPLE 1",
3939
"Markdown": "Create a WebSocket job that connects to a WebSocket and outputs the results.",
40-
"Code": "Get-WebSocket -SocketUrl \"wss://localhost:9669/\""
40+
"Code": "$socketServer = Get-WebSocket -RootUrl \"http://localhost:8387/\" -HTML \"<h1>WebSocket Server</h1>\"\n$socketClient = Get-WebSocket -SocketUrl \"ws://localhost:8387/\""
4141
},
4242
{
4343
"Title": "EXAMPLE 2",
44-
"Markdown": "Get is the default verb, so we can just say WebSocket.\n`-Watch` will output a continous stream of objects from the websocket.\nFor example, let's Watch BlueSky, but just the text. ",
45-
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -Watch |\n % { \n $_.commit.record.text\n }"
44+
"Markdown": "Get is the default verb, so we can just say WebSocket.\n`-Watch` will output a continous stream of objects from the websocket.\nFor example, let's Watch BlueSky, but just the text ",
45+
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -Watch -Maximum 1kb |\n % { \n $_.commit.record.text\n }"
4646
},
4747
{
4848
"Title": "EXAMPLE 3",
4949
"Markdown": "Watch BlueSky, but just the text and spacing",
50-
"Code": "$blueSkySocketUrl = \"wss://jetstream2.us-$(\n 'east','west'|Get-Random\n).bsky.network/subscribe?$(@(\n \"wantedCollections=app.bsky.feed.post\"\n) -join '&')\"\nwebsocket $blueSkySocketUrl -Watch | \n % { Write-Host \"$(' ' * (Get-Random -Max 10))$($_.commit.record.text)$($(' ' * (Get-Random -Max 10)))\"}"
50+
"Code": "$blueSkySocketUrl = \"wss://jetstream2.us-$(\n 'east','west'|Get-Random\n).bsky.network/subscribe?$(@(\n \"wantedCollections=app.bsky.feed.post\"\n) -join '&')\"\nwebsocket $blueSkySocketUrl -Watch | \n % { Write-Host \"$(' ' * (Get-Random -Max 10))$($_.commit.record.text)$($(' ' * (Get-Random -Max 10)))\"} -Max 1kb"
5151
},
5252
{
5353
"Title": "EXAMPLE 4",
54-
"Markdown": "",
54+
"Markdown": "Watch continuously in a background job.",
5555
"Code": "websocket wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post"
5656
},
5757
{
5858
"Title": "EXAMPLE 5",
59-
"Markdown": "",
60-
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe -QueryParameter @{ wantedCollections = 'app.bsky.feed.post' } -Max 1 -Debug"
59+
"Markdown": "Watch the first message in -Debug mode. \nThis allows you to literally debug the WebSocket messages as they are encountered.",
60+
"Code": "websocket wss://jetstream2.us-west.bsky.network/subscribe -QueryParameter @{\n wantedCollections = 'app.bsky.feed.post'\n} -Max 1 -Debug"
6161
},
6262
{
6363
"Title": "EXAMPLE 6",
6464
"Markdown": "Watch BlueSky, but just the emoji",
65-
"Code": "websocket jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -Tail |\n Foreach-Object {\n $in = $_\n if ($in.commit.record.text -match '[\\p{IsHighSurrogates}\\p{IsLowSurrogates}]+') {\n Write-Host $matches.0 -NoNewline\n }\n }"
65+
"Code": "websocket jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.feed.post -Tail -Max 1kb |\n Foreach-Object {\n $in = $_\n if ($in.commit.record.text -match '[\\p{IsHighSurrogates}\\p{IsLowSurrogates}]+') {\n Write-Host $matches.0 -NoNewline\n }\n }"
6666
},
6767
{
6868
"Title": "EXAMPLE 7",

0 commit comments

Comments
 (0)