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("
|
| 2388 |
})
|
| 2389 |
|
| 2390 |
scrape_status_msg(result)
|
|
|
|
| 2374 |
|
| 2375 |
# Scrape button
|
| 2376 |
observeEvent(input$scrape_btn, {
|
| 2377 |
+
scrape_status_msg("Testing FTP connection...")
|
| 2378 |
|
| 2379 |
result <- tryCatch({
|
| 2380 |
+
ftp_url <- paste0("ftp://", Sys.getenv("FTP_USERNAME"), ":",
|
| 2381 |
+
Sys.getenv("FTP_PASSWORD"),
|
| 2382 |
+
"@ftp.trackmanbaseball.com/v3/2025/04/01/CSV/")
|
| 2383 |
+
file_list <- RCurl::getURL(ftp_url, ftp.use.epsv = FALSE,
|
| 2384 |
+
dirlistonly = TRUE, connecttimeout = 10)
|
| 2385 |
+
paste("Connected! Files found:", nchar(file_list), "chars")
|
| 2386 |
}, error = function(e) {
|
| 2387 |
+
paste("FTP failed:", e$message)
|
| 2388 |
})
|
| 2389 |
|
| 2390 |
scrape_status_msg(result)
|