Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
sugyan committed Jun 19, 2024
1 parent 0053b0c commit e63dd18
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
14 changes: 8 additions & 6 deletions atrium-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Any HTTP client that implements [`atrium_xrpc::HttpClient`](https://docs.rs/atri

```rust,no_run
use atrium_api::client::AtpServiceClient;
use atrium_api::com::atproto::server::create_session::Input;
use atrium_xrpc_client::reqwest::ReqwestClient;
#[tokio::main]
Expand All @@ -25,11 +24,14 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.com
.atproto
.server
.create_session(Input {
auth_factor_token: None,
identifier: "[email protected]".into(),
password: "hunter2".into(),
})
.create_session(
atrium_api::com::atproto::server::create_session::InputData {
auth_factor_token: None,
identifier: "[email protected]".into(),
password: "hunter2".into(),
}
.into(),
)
.await;
println!("{:?}", result);
Ok(())
Expand Down
24 changes: 13 additions & 11 deletions bsky-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let moderator = agent.moderator(&preferences).await?;
// in feeds
for feed_view_post in agent
let output = agent
.api
.app
.bsky
.feed
.get_timeline(atrium_api::app::bsky::feed::get_timeline::Parameters {
algorithm: None,
cursor: None,
limit: None,
})
.await?
.feed
{
.get_timeline(
atrium_api::app::bsky::feed::get_timeline::ParametersData {
algorithm: None,
cursor: None,
limit: None,
}
.into(),
)
.await?;
for feed_view_post in &output.feed {
// We call the appropriate moderation function for the content
let post_mod = moderator.moderate_post(&feed_view_post.post);
// don't include in feeds?
Expand Down Expand Up @@ -127,7 +129,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
assert!(segments[2].text == ", check out this link: ");
assert!(segments[3].text == "https://example.com" && segments[3].link().is_some());
let post_record = atrium_api::app::bsky::feed::post::Record {
let record_data = atrium_api::app::bsky::feed::post::RecordData {
created_at: atrium_api::types::string::Datetime::now(),
embed: None,
entities: None,
Expand All @@ -138,7 +140,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
tags: None,
text: rt.text,
};
println!("{:?}", post_record);
println!("{:?}", record_data);
Ok(())
}
```
Expand Down

0 comments on commit e63dd18

Please sign in to comment.