GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Matrix89/lexicon-rs

BranchesTags
Open more actions menu

Latest commit

 

History

25 Commits
25 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
lib
lib
 
 
src
src
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 

Repository files navigation

Lexicon-rs

WIP

ATProto's lexicon to rust - inator

The code is nowhere close to being of any quality as of yet

cargo run takes lexicon defintions from a hardcoded patch on my machine and puts the generated code in ./lib/test/src/lex.rs

Creating a session

let session = create_session::main(
        &"".to_owned(),
        create_session::MainInput {
password: "".to_owned(),
identifier: "".to_owned(),
},
)
.await;

Creating a new record(post in this case)

let time: DateTime<Utc> = SystemTime::now().into();
let post = lex::lexicon::app::bsky::feed::post::Main {
facets: None,
            reply: None,
            entities: None,
            embed: None,
            text: "Hello from rust \\o/".to_owned(),
            created_at: time.to_rfc3339(),
};

let res = lex::lexicon::com::atproto::repo::create_record::main(
        &token,
        lex::lexicon::com::atproto::repo::create_record::MainInput {
collection: "app.bsky.feed.post".to_owned(),
repo: session.did.clone(),
rkey: Some(session.did),
record: serde_json::json!(&post),
swap_commit: None,
validate: Some(true),
},
)
.await
.unwrap();

Getting own timeline

let res = get_timeline::main(&token, "".to_owned(), "".to_owned(), 32);
let res = res.await.unwrap();
let actor = lex::lexicon::app::bsky::actor::get_profile::main(
        &token,
        "matrix89.bsky.social".to_owned(),
        )
.await;

for post in res.feed {
    if post.post.viewer.is_some() {
        println!("{:?}", post.post.record);
    }
}

About

No description, website, or topics provided.

Resources

Readme
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.