Spaces:
Running
Running
Update app.R
Browse files
app.R
CHANGED
|
@@ -2374,17 +2374,17 @@ removeModal()
|
|
| 2374 |
|
| 2375 |
# Scrape button
|
| 2376 |
observeEvent(input$scrape_btn, {
|
| 2377 |
-
scrape_status_msg("Testing
|
| 2378 |
|
| 2379 |
result <- tryCatch({
|
| 2380 |
-
|
| 2381 |
-
|
| 2382 |
-
|
| 2383 |
-
|
| 2384 |
-
|
| 2385 |
-
paste("Connected!
|
| 2386 |
}, error = function(e) {
|
| 2387 |
-
paste("FTP failed:", e$message)
|
| 2388 |
})
|
| 2389 |
|
| 2390 |
scrape_status_msg(result)
|
|
|
|
| 2374 |
|
| 2375 |
# Scrape button
|
| 2376 |
observeEvent(input$scrape_btn, {
|
| 2377 |
+
scrape_status_msg("Testing curl FTP...")
|
| 2378 |
|
| 2379 |
result <- tryCatch({
|
| 2380 |
+
h <- curl::new_handle()
|
| 2381 |
+
curl::handle_setopt(h, userpwd = paste0(Sys.getenv("FTP_USERNAME"), ":", Sys.getenv("FTP_PASSWORD")))
|
| 2382 |
+
con <- curl::curl("ftp://ftp.trackmanbaseball.com/v3/2025/04/01/CSV/", handle = h)
|
| 2383 |
+
lines <- readLines(con)
|
| 2384 |
+
close(con)
|
| 2385 |
+
paste("Connected! Found:", length(lines), "files")
|
| 2386 |
}, error = function(e) {
|
| 2387 |
+
paste("curl FTP failed:", e$message)
|
| 2388 |
})
|
| 2389 |
|
| 2390 |
scrape_status_msg(result)
|