Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/threddyrex/dnproto
Writing code for ATProto using dotnet
https://github.com/threddyrex/dnproto
atproto bluesky
Last synced: 11 days ago
JSON representation
Writing code for ATProto using dotnet
- Host: GitHub
- URL: https://github.com/threddyrex/dnproto
- Owner: threddyrex
- License: mit
- Created: 2024-12-30T20:41:38.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2025-01-22T22:29:12.000Z (12 days ago)
- Last Synced: 2025-01-22T23:25:23.753Z (12 days ago)
- Topics: atproto, bluesky
- Language: C#
- Homepage:
- Size: 272 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# dnproto - an ATProto/Bluesky tool written in dotnet
This is a tool written in C# for interacting with ATProto and Bluesky. It's a work in progress.
The sections below explain how to use the command line tool.
If you are interested in using the C# repo parsing code, check out [Repo.cs](/src/repo/Repo.cs) in the repo directory to get started.
That's the entry point to those classes.
# Building dnproto
```powershell
cd .\src\
dotnet build
```
# Showing the help
You can view help for the utility by calling it with no arguments.
```powershell
.\dnproto.exe
```
# Running a command
Each feature of the utility is a "command". You can specify which command you want when running the tool, along with arguments.
To run one of the commands:
```powershell
.\dnproto.exe /command /arg1 value1 /arg2 value2...
```Calling dnproto with no arguments will print the help.
# Resolving a Bluesky handle
This calls the [Bluesky public API](https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle) to resolve a handle.
```powershell
.\dnproto.exe /command handle_resolve /handle threddyrex.com
```
# Getting a Bluesky profile
This calls the [Bluesky public API](https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile) to get the profile.
```powershell
.\dnproto.exe /command profile_get /actor threddyrex.com
```
# Getting repo status
With handle:
```powershell
.\dnproto.exe /command repo_getstatus /handle "threddyrex.org"
```Or with did and pds:
```powershell
.\dnproto.exe /command repo_getstatus /did "did:plc:watmxkxfjbwyxfuutganopfk" /pds "pds01.threddy.social"
```
# Downloading a user's repo
Calls getRepo for the user, and writes the file to repoFilePath.
Using handle:
```powershell
.\dnproto.exe /command repo_get /handle "threddyrex.org" /repofilepath "myfile.car"
```Or using did and pds:
```powershell
.\dnproto.exe /command repo_get /did "did:plc:watmxkxfjbwyxfuutganopfk" /pds "pds01.threddy.social" /repofilepath "myfile.car"
```
# Logging in and interacting as the user.
You can create a session on the server. The token for the session is
stored in a file on local disk (specified by $sessionFile).```powershell
$sessionFile = "sessionfile.txt"# log in
.\dnproto.exe /command session_create /sessionfile $sessionFile /handle "handle" /password "password"# create a post
.\dnproto.exe /command session_post /sessionfile $sessionFile /text "text of post"# get unread notification count
.\dnproto.exe /command session_getunreadcount /sessionfile $sessionFile# log out
.\dnproto.exe /command session_delete /sessionfile $sessionFile
```
# Comparing Two Repositories
You can compare the interactions between two repos (accounts) using the following.
It will print out likes, replies, reposts, and quote posts.```powershell
# Download first repo from Bluesky
.\dnproto.exe /command repo_get /handle "handle1.com" /repofile "handle1.car"# Download second repo from Bluesky
.\dnproto.exe /command repo_get /handle "handle2.com" /repofile "handle2.car"# Compare the two repo files on disk and print out interactions
.\dnproto.exe /command repo_compare /repofile1 "handle1.car" /repofile2 "handle2.car"
```
# Write json responses to disk
Many of the commands are just calls to the Bluesky APIs, which return json responses.
These commands usually provide a "outfile" argument for writing the response to disk:```powershell
.\dnproto.exe /command repo_getstatus /did "did:web:threddyrex.org" /pds "pds01.threddy.social" /outfile "file_path_to_create"
```