diff --git a/TODO.md b/TODO.md index fb50ff0..993e5bd 100644 --- a/TODO.md +++ b/TODO.md @@ -16,3 +16,13 @@ all of the normalization work should not have been done here, we should have created our own platform so people can register and pay later (either in cash, or using 3rd party payment like stripe) +## 2023-12-28 + +TODO: +- more configuration options + - configurable proxy +- summary of the operations at the end of run + - how many users were added, muted? +- conjoined user: add attached member to paheko + - "Membre lié" +- is this kind of thing even accessible on the API-level ? diff --git a/src/helloasso.rs b/src/helloasso.rs index c7bf13a..9d44684 100644 --- a/src/helloasso.rs +++ b/src/helloasso.rs @@ -53,9 +53,10 @@ impl Client { // decoy user agent default_headers.insert("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/112.0".parse().unwrap()); - let proxy = reqwest::Proxy::https("https://localhost:8999").unwrap(); + // TODO: configurable proxy + // let proxy = reqwest::Proxy::https("https://localhost:8999").unwrap(); reqwest::Client::builder() - .proxy(proxy) + // .proxy(proxy) .default_headers(default_headers) } diff --git a/src/main.rs b/src/main.rs index c1a413b..60fad76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -407,5 +407,14 @@ async fn launch_adapter() -> Result<()> { #[tokio::main] async fn main() { // TODO: add argument parser to have handle config file - let _res = launch_adapter().await; + let res = launch_adapter().await; + match res { + Err(err) => { + eprintln!("Program failed, details bellow"); + eprintln!("{:?}", err); + }, + Ok(()) => { + eprintln!("Program done"); + } + } } diff --git a/src/paheko.rs b/src/paheko.rs index bea165e..0b1f4fb 100644 --- a/src/paheko.rs +++ b/src/paheko.rs @@ -156,10 +156,11 @@ impl Client { fn get_base_client_builder() -> reqwest::ClientBuilder { let mut default_headers = reqwest::header::HeaderMap::new(); default_headers.insert("Accept", "application/json".parse().unwrap()); + default_headers.insert("User-Agent", "helloasso_paheko_adapter".parse().unwrap()); - let proxy = reqwest::Proxy::http("http://localhost:8998").unwrap(); + // let proxy = reqwest::Proxy::http("http://localhost:8998").unwrap(); reqwest::Client::builder() - .proxy(proxy) + // .proxy(proxy) .default_headers(default_headers) }