knitr::opts_chunk$set(eval = FALSE)

2022-02-13

1. What I did:

Read the provided documents/books about how to work with the project, and did some research on the APIs that can be used for the project.

2. Its role in the bigger group picture:

Provided an option for the group to choose.

3. Link to github commit:

The github repo hasn't been set up yet.

2022-02-14

1. What I did:

base_url <- "http://api.weatherapi.com/v1/history.json?"
  full_url <- POST(base_url, query = list(key=key,q=q,dt=dt),encode = "raw")
  path<-paste0("key=",key,"&q=",q,"&dt=",dt)
  resp <- GET(full_url)
if (http_type(resp) != "application/json") {
    stop("API did not return json", call. = FALSE)
  }
parsed <- jsonlite::fromJSON(content(resp, as = "text", encoding = "UTF-8"), simplifyVector = FALSE)
if (http_error(resp)) {
    stop(
      sprintf(
        "GitHub API request failed [%s]\n%s\n<%s>", 
        status_code(resp),
        parsed$error$message,
        parsed$error$code
      ),
      call. = FALSE
    )
  }
structure(
    list(
      location_data= parsed[[1]],
      daily_data = parsed[[2]]$forecastday[[1]]$day,
      astro_data= parsed[[2]]$forecastday[[1]]$astro,
      hourly_data=parsed[[2]]$forecastday[[1]]$hour,
      path = path,
      response = resp,
      class = "weather_api_history"
    )
  )
res<-weather_api_history("##samplekeyhere##","London","2022-02-08")
#(1)data
#location data
res$location_data
#daily temp summary
res$daily_data
#astro data
res$astro_data
#hourly data
length(res$hourly_data)#a list
res$hourly_data[[1]]
#(2)information
#path
res$path
#response
res$response
#class
res$class

2. Its role in the bigger group picture:

The "history" part is one out of the 3 critical parts we are going to query.

3. Link to github commit:

https://github.com/xintian927/534-proejct/commit/5f0d6356411705a902f02411c9bbf6824816dfb9

2022-02-15

1. What I did:

2. Its role in the bigger group picture:

3. Link to github commit:

https://github.com/xintian927/534-proejct/commit/8d08fa754f9843ed8563728ea55b8ee561073d88

2022-02-16

1. What I did:

2. Its role in the bigger group picture:

3. Link to github commit:

https://github.com/xintian927/534-proejct/commit/af2e22367c9a9bec55b47d69ed4a413142d340f2

2022-02-17

1. What I did:

2. Its role in the bigger group picture:

3. Link to github commit:

2022-02-18

1. What I did:

2. Its role in the bigger group picture:

3. Link to github commit:



evelynsugi/weatherapi documentation built on April 7, 2022, 12:43 p.m.