MCPcopy Create free account
hub / github.com/GCWing/BitFun / fetch_description_from_skill_page

Function fetch_description_from_skill_page

src/apps/desktop/src/api/skill_api.rs:1283–1305  ·  view source on GitHub ↗
(client: &Client, page_url: &str)

Source from the content-addressed store, hash-verified

1281}
1282
1283async fn fetch_description_from_skill_page(client: &Client, page_url: &str) -> Option<String> {
1284 let response = timeout(
1285 Duration::from_secs(MARKET_DESC_FETCH_TIMEOUT_SECS),
1286 client.get(page_url).send(),
1287 )
1288 .await
1289 .ok()?
1290 .ok()?;
1291
1292 if !response.status().is_success() {
1293 return None;
1294 }
1295
1296 let html = timeout(
1297 Duration::from_secs(MARKET_DESC_FETCH_TIMEOUT_SECS),
1298 response.text(),
1299 )
1300 .await
1301 .ok()?
1302 .ok()?;
1303
1304 extract_description_from_html(&html)
1305}
1306
1307fn extract_description_from_html(html: &str) -> Option<String> {
1308 if let Some(prose_index) = html.find("class=\"prose") {

Callers 1

fill_market_descriptionsFunction · 0.85

Calls 6

textMethod · 0.80
okMethod · 0.45
sendMethod · 0.45
getMethod · 0.45
statusMethod · 0.45

Tested by

no test coverage detected