Skip to content

Commit

Permalink
Image
Browse files Browse the repository at this point in the history
  • Loading branch information
drasticactions committed Dec 29, 2023
1 parent 92907ab commit 7c58ea4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/FishyFlipSamplesApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using FishyFlip.Tools;
using Sharprompt;
using System.ComponentModel.DataAnnotations;
using static System.Runtime.InteropServices.JavaScript.JSType;

Console.WriteLine("FishyFlipSamplesApp");

Expand Down Expand Up @@ -99,6 +100,10 @@ async Task GetAvatarForProfile(ATProtocol protocol)
// The avatar is a byte array, so we can save it to disk.
File.WriteAllBytes($"avatar.jpg", avatar.Data);
Console.WriteLine("Avatar saved to disk.");

// We can also call on the BlueSky instance to get the avatar via a URL
var imageUri = $"https://{protocol.Options.Url.Host}{Constants.Urls.ATProtoSync.GetBlob}?did={actorRecord.Uri.Did!}&cid={actorRecord.Value.Avatar.Ref.Link}";
Console.WriteLine($"Avatar URL: {imageUri}");
}

async Task<ActorRecord?> GetProfileViaHandle(ATProtocol protocol)
Expand Down

0 comments on commit 7c58ea4

Please sign in to comment.