This commit is contained in:
Maieul BOYER 2026-02-06 23:24:21 +01:00
parent 8afdd208c6
commit 8e82ec9523
Signed by: maix
SSH key fingerprint: SHA256:iqCzqFFF5KjRixmDExqbAltCIj9ndlBWIGJf3t9Ln9g
23 changed files with 3345 additions and 0 deletions

View file

@ -0,0 +1,37 @@
use froxy_scrapper::{state::State, types::ClusterLocation};
#[tokio::main(flavor = "current_thread")]
async fn main() {
let session = std::env::var("FROXY_COOKIE")
.expect("provide `FROXY_COOKIE` with the session cookie from you friends42 instance");
let state = State::new(session);
let res = state.get("/", Some("cluster=f4")).await.unwrap();
let text = res.text().await.unwrap();
let location = froxy_scrapper::parsing::get_cluster_location("F4", &text);
for l in &location.locations {
match &l.data {
froxy_scrapper::types::ClusterLocationData::Empty => {}
froxy_scrapper::types::ClusterLocationData::User {
login,
image,
relation,
} => {
eprintln!(
"[{:<10}] {login:<10} {relation:?} {}",
l.location,
image
.as_ref()
.map(|i| i.to_string())
.unwrap_or_else(|| "NO IMAGE".to_string())
)
}
froxy_scrapper::types::ClusterLocationData::Normal { status } => {
//eprintln!("[{:<10}] {status:?}", l.location)
}
}
}
}