Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions committed Dec 29, 2023
1 parent 7c58ea4 commit 7df45c1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions samples/FishyFlip.Firehose/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,16 @@ async Task HandleMessageAsync(SubscribeRepoMessage message)
if (message.Record is not null)
{
Console.WriteLine($"Record: {message.Record.Type}");

if (message.Record is Post post)
{
// The Actor Did.
var did = message.Commit.Repo;
// Commit.Ops are the actions used when creating the message.
// In this case, it's a create record for the post.
// The path contains the post action and path, we need the path, so we split to get it.
var url = $"https://bsky.app/profile/{did}/post/{message.Commit.Ops![0]!.Path!.Split("/").Last()}";
Console.WriteLine($"Post URL: {url}");
}
}
}

0 comments on commit 7df45c1

Please sign in to comment.