Open the Program.cs file in your editor of choice and change its contents to the following code, replacing
the "handle" and "password" parameters in the agent.Login() call with your Bluesky handle and password.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
Save the changed file.
Open the Program.cs file from the Solution Explorer window and change its contents to the following code, replacing
the "handle" and "password" parameters for in the agent.Login() call with your Bluesky handle and password.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
Save the changed file.
Open the Program.cs file from the Explorer window and change its contents to the following code, replacing
the "handle" and "password" parameters for the agent.Login() method with your Bluesky handle and password.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
Save the changed file.
Open
Tip
You can create and use an App password instead of your login password.
App Passwords are safer as they allow sign in without granting full access to your Bluesky account.
Continue to change Program.cs by adding an additional line to create a post.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
await agent.Post("Hello World from idunno.Bluesky");
Save the changed file and exit your editor.
Compile and run your project with the following command
dotnet run
Continue to change Program.cs by adding an additional line to create a post.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
await agent.Post("Hello World from idunno.Bluesky");
Save the changed file.
Run the project by pressing F5 or choosing Start Debugging under the Debug menu.
Continue to change Program.cs by adding an additional line to create a post.
using idunno.Bluesky;
using BlueskyAgent agent = new();
await agent.Login(handle, password);
await agent.Post("Hello World from idunno.Bluesky");
Save the changed file.
Run the project by pressing F5 or choosing Start Debugging under the Run menu.
The program should run without any errors, and if you check your own profile (click the Profile link in the app, or on bsky.app)
you should see a post that says "Hello World from idunno.Bluesky".
Congratulations, you've just posted from code!
You can @ someone in the post text, add hashtags, or http/https links and they will all get turned into the right type of link. Try it and check in the app.