From 73b4a52dd0f92646f32013bb590ad10cd160e04f Mon Sep 17 00:00:00 2001 From: eneller Date: Sat, 17 Jan 2026 06:50:05 +0100 Subject: [PATCH] chore: cleanup move to own github version of openSkies for new auth --- renv.lock | 20 +++++++++++++------- src/main.Rmd | 31 ++++++++++++++++--------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/renv.lock b/renv.lock index 0dfcc5f..4ded65f 100644 --- a/renv.lock +++ b/renv.lock @@ -1897,12 +1897,13 @@ }, "openSkies": { "Package": "openSkies", - "Version": "1.2.2", - "Source": "Repository", + "Version": "1.2.1", + "Source": "GitHub", "Type": "Package", "Title": "Retrieval, Analysis and Visualization of Air Traffic Data", - "Date": "2025-08-20", - "Authors@R": "c( person(\"Rafael\", \"Ayala\", email = \"rafaelayalahernandez@gmail.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-9332-4623\")), person(\"Daniel\", \"Ayala\", email = \"dayala1@us.es\", role = \"aut\", comment = c(ORCID = \"0000-0003-2095-1009\")), person(\"David\", \"Ruiz\", email = \"druiz@us.es\", role = \"aut\", comment = c(ORCID = \"0000-0003-4460-5493\")), person(\"Aleix\", \"Sellés\", role = \"aut\"), person(\"Lara\", \"Selles Vidal\", email = \"lara.selles@oist.jp\", role = \"aut\", comment = c(ORCID = \"0000-0003-2537-6824\")))", + "Date": "2024-04-03", + "Author": "Rafael Ayala, Daniel Ayala, David Ruiz, Aleix Sellés, Lara Sellés Vidal", + "Maintainer": "Rafael Ayala ", "Description": "Provides functionalities and data structures to retrieve, analyze and visualize aviation data. It includes a client interface to the 'OpenSky' API . It allows retrieval of flight information, as well as aircraft state vectors.", "Acknowledgements": "The development of this software is supported by the Spanish Ministry of Science and Innovation (grant code PID2019-105471RB-I00) and the Regional Government of Andalusia (grant code P18-RT-1060).", "License": "CC BY-NC 4.0", @@ -1928,6 +1929,7 @@ "knitr", "BiocStyle", "RUnit", + "BiocGenerics", "rmarkdown", "markdown" ], @@ -1935,9 +1937,13 @@ "BugReports": "https://github.com/Rafael-Ayala/openSkies/issues", "NeedsCompilation": "no", "Encoding": "UTF-8", - "Repository": "https://packagemanager.posit.co/cran/latest", - "Author": "Rafael Ayala [aut, cre] (ORCID: ), Daniel Ayala [aut] (ORCID: ), David Ruiz [aut] (ORCID: ), Aleix Sellés [aut], Lara Selles Vidal [aut] (ORCID: )", - "Maintainer": "Rafael Ayala " + "Repository": "CRAN", + "RemoteType": "github", + "RemoteHost": "api.github.com", + "RemoteUsername": "eneller", + "RemoteRepo": "openSkies", + "RemoteRef": "main", + "RemoteSha": "6841db8a4cd483260c95146a7531973b692d553a" }, "openssl": { "Package": "openssl", diff --git a/src/main.Rmd b/src/main.Rmd index 6718e62..ee7683b 100644 --- a/src/main.Rmd +++ b/src/main.Rmd @@ -10,8 +10,8 @@ date: "`r Sys.Date()`" knitr::opts_chunk$set(echo = TRUE) ``` -# Load Library -```{r preamble, echo=FALSE} +```{r preamble, message=FALSE} +# Load Libraries library(dplyr) library(lubridate) library(readr) @@ -20,26 +20,27 @@ library(openSkies) library(dotenv) library(httr) library(jsonlite) + ``` + # Download flights -```{r include=FALSE} -# -#time_now <- Sys.time() -#time_one_hour_ago <- time_now - 3600 -# -## get departures from frankfurt airport -#flights <- getAirportDepartures(airport = "EDDF", startTime = time_one_hour_ago, endTime = time_now) -# -#print(paste("Found flights:", length(flights))) -#head(flights) +```{r opensky_lib, include=FALSE} + +time_now <- Sys.time() +time_one_hour_ago <- time_now - 3600 + +# get departures from frankfurt airport +flights <- getAirportDepartures(airport = "EDDF", startTime = time_one_hour_ago, endTime = time_now ) +print(paste("Found flights:", length(flights))) +head(flights) ``` -```{r openskies, include=FALSE} -load_dot_env() +```{r opensky_rest, include=FALSE} +# gets opensky data using the REST API at https://openskynetwork.github.io/opensky-api/rest.html + my_client_id <- Sys.getenv("OPENSKY_CLIENT_ID") my_client_secret <- Sys.getenv("OPENSKY_CLIENT_SECRET") - token_url <- "https://auth.opensky-network.org/auth/realms/opensky-network/protocol/openid-connect/token" token_resp <- POST(