36 lines
883 B
Rust
36 lines
883 B
Rust
use std::process;
|
|
|
|
use kuska_ssb::api::dto::content::{SubsetQuery, TypedMessage, Post};
|
|
|
|
use golgi::error::GolgiError;
|
|
use golgi::sbot::Sbot;
|
|
|
|
async fn run() -> Result<(), GolgiError> {
|
|
let mut sbot_client = Sbot::init(None, None).await?;
|
|
|
|
let id = sbot_client.whoami().await?;
|
|
println!("{}", id);
|
|
|
|
let author = "@L/z54cbc8V1kL1/MiBhpEKuN3QJkSoZYNaukny3ghIs=.ed25519".to_string();
|
|
|
|
println!("Calling create_history");
|
|
let hist_response = sbot_client.create_history_stream(author).await?;
|
|
println!("hist: {:?}", hist_response);
|
|
|
|
let posts: Vec<Post> = hist_response.iter().flat_map(|msg| msg.into_post()).collect();
|
|
|
|
for post in posts {
|
|
println!("post: {:?}", post);
|
|
}
|
|
|
|
Ok(())
|
|
}
|
|
|
|
#[async_std::main]
|
|
async fn main() {
|
|
if let Err(e) = run().await {
|
|
eprintln!("Application error: {}", e);
|
|
process::exit(1);
|
|
}
|
|
}
|