Initial commit: Successfully gets client
This commit is contained in:
commit
d60e4958cc
4 changed files with 2301 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
/target
|
2259
Cargo.lock
generated
Normal file
2259
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load diff
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
|
@ -0,0 +1,8 @@
|
|||
[package]
|
||||
name = "untagged-tagger"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
tokio = { version = "1.42.0", features = ["full"] }
|
||||
wallabag-api = "0.4.3"
|
33
src/main.rs
Normal file
33
src/main.rs
Normal file
|
@ -0,0 +1,33 @@
|
|||
use std::env;
|
||||
use wallabag_api::types::{Config /*, EntriesFilter, SortBy, SortOrder*/ };
|
||||
use wallabag_api::Client;
|
||||
|
||||
fn get_client() -> Result<Client, Box<dyn std::error::Error>> {
|
||||
let config = Config {
|
||||
client_id: String::from("7_iwawqc3fc3k0k04s8cwwkkk8sgogkcw40swkgs4ocs8sk8wgo"),
|
||||
client_secret: env::var("WALLABAG_CLIENT_SECRET").expect("not set"),
|
||||
username: String::from("adam"),
|
||||
password: env::var("WALLABAG_PASSWORD").expect("not set"),
|
||||
base_url: String::from("https://wallabag.theadamcooper.com/"),
|
||||
};
|
||||
let client = Client::new(config);
|
||||
println!("{:?}", client);
|
||||
Ok(client)
|
||||
}
|
||||
|
||||
/*
|
||||
async fn get_entries(client: Client) -> ClientResult<Entries> {
|
||||
}
|
||||
*/
|
||||
|
||||
// #[tokio::main]
|
||||
/*async*/ fn main() -> std::io::Result<()> {
|
||||
println!("Hello, world!");
|
||||
// get token (hard code at first0
|
||||
// let token = "badc0ffee";
|
||||
let _client = get_client();
|
||||
// get entries
|
||||
// let all_entries = get_entries(client).await?.unwrap();
|
||||
// tag entries
|
||||
Ok(())
|
||||
}
|
Loading…
Add table
Reference in a new issue