A better Rust ATProto crate
103
fork

Configure Feed

Select the types of activity you want to include in your feed.

dumb bug in the file auth store impl

Orual d29f164b 10d719d2

+7 -9
+3 -1
crates/jacquard-common/src/session.rs
··· 94 94 /// Create a new file token store at the given path. 95 95 pub fn new(path: impl AsRef<Path>) -> Self { 96 96 std::fs::create_dir_all(path.as_ref().parent().unwrap()).unwrap(); 97 - std::fs::write(path.as_ref(), b"{}").unwrap(); 97 + if !path.as_ref().exists() { 98 + std::fs::write(path.as_ref(), b"{}").unwrap(); 99 + } 98 100 99 101 Self { 100 102 path: path.as_ref().to_path_buf(),
+4 -8
crates/jacquard/src/richtext.rs
··· 1080 1080 1081 1081 /// Fetch OpenGraph metadata from a URL using the webpage crate 1082 1082 #[cfg(feature = "api_bluesky")] 1083 - async fn fetch_opengraph_metadata<C>( 1083 + pub async fn fetch_opengraph_metadata<C>( 1084 1084 client: &C, 1085 1085 url: &str, 1086 1086 ) -> Result<Option<ExternalMetadata<'static>>, Box<dyn std::error::Error + Send + Sync>> ··· 1091 1091 let request = http::Request::builder() 1092 1092 .method("GET") 1093 1093 .uri(url) 1094 - .header("User-Agent", "jacquard/0.6") 1095 - .body(Vec::new()) 1096 - .map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)?; 1094 + .header("User-Agent", "jacquard/0.8") 1095 + .body(Vec::new())?; 1097 1096 1098 1097 // Fetch the page 1099 - let response = client 1100 - .send_http(request) 1101 - .await 1102 - .map_err(|e| Box::new(e) as Box<dyn std::error::Error + Send + Sync>)?; 1098 + let response = client.send_http(request).await?; 1103 1099 1104 1100 // Parse HTML body 1105 1101 let html = String::from_utf8_lossy(response.body());