(client: &Client, page_url: &str)
| 1281 | } |
| 1282 | |
| 1283 | async 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 | |
| 1307 | fn extract_description_from_html(html: &str) -> Option<String> { |
| 1308 | if let Some(prose_index) = html.find("class=\"prose") { |
no test coverage detected