Bluesky が提供している API を Scala で扱うライブラリ
JitPack で公開しています
// build.gradle
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'com.github.l7u7ch:dious:main-SNAPSHOT'
}
<!-- pom.xml -->
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.l7u7ch</groupId>
<artifactId>dious</artifactId>
<version>main-SNAPSHOT</version>
</dependency>
// build.sbt
resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.l7u7ch" % "dious" % "main-SNAPSHOT"
//> using repository "jitpack"
//> using dep com.github.l7u7ch:dious:main-SNAPSHOT
import com.github.l7u7ch.dious.*
@main def Main(): Unit = {
val agent = Agent(service = "https://bsky.social/")
agent.createSession(
identifier = "<USER_ID>",
password = "<APP_PASSWORD>"
)
agent.createRecord("Hello, World!!")
}
// com.atproto.server.*
def createSession(identifier: String, password: String): String
// com.atproto.repo.*
def createRecord(msg: String): String
def deleteRecord(rkey: String): String
def getRecord(collection: String = "app.bsky.feed.post", rkey: String): String
def listRecords(collection: String = "app.bsky.feed.post", limit: Int = 50): String
// 非推奨
def deleteLike(rkey: String): String
def deleteRepost(rkey: String): String
def getActorLikes(limit: Int = 50, cursor: String = ""): String
def getAuthorFeed(limit: Int = 50, cursor: String = ""): String