aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2017-06-07 15:15:09 -0400
committerMike Holmes <mike.holmes@linaro.org>2017-06-07 15:15:09 -0400
commitc179c6b0c65e24946339a1388d40e814f2646bc7 (patch)
treee35224cb9d1bfc7e204d4f6a57af679b96455577
parent933e11813a6eb8e9cb7b55b6e4f25996636b24ef (diff)
fix lists of patches > 5000
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
-rw-r--r--Signed_off_heatmaps.R31
1 files changed, 24 insertions, 7 deletions
diff --git a/Signed_off_heatmaps.R b/Signed_off_heatmaps.R
index 75d0e01..539d006 100644
--- a/Signed_off_heatmaps.R
+++ b/Signed_off_heatmaps.R
@@ -13,19 +13,36 @@ library(plyr)
get_tags <- function (id) {
#http://patches.linaro.org/api/1.0/teams/39/commit-tags/
+ page <- 1
baseurl <- "http://patches.linaro.org/api/1.0/"
- type <- paste("teams/",id,"/commit-tags/?format=json&per_page=5000", sep = "")
+ type <- paste("teams/", id, "/commit-tags/?format=json&per_page=5000&page=", page, sep = "")
url <- paste(baseurl, type, sep = "")
- cat (url,"\n")
- webpage <- curl (url, handle = h)
+ #empty container for all data returned
+ all_data = data.frame()
+
+ #keep pulling pages while they exist
+ repeat {
+ cat (url,"\n")
+ webpage <- curl (url, handle = h)
+
+ #get data it into R
+ jira_tags_raw <- fromJSON(webpage, simplifyMatrix = TRUE, simplifyVector =TRUE, simplifyDataFrame = TRUE, flatten = TRUE)
- #get data it into R
- jira_tags_raw <- fromJSON(webpage,simplifyMatrix = TRUE, simplifyVector =TRUE, simplifyDataFrame = TRUE, flatten = TRUE)
- m <- data.frame(tag=jira_tags_raw$tag, person=jira_tags_raw$person)
+ new_data <- data.frame(tag=jira_tags_raw$tag, person=jira_tags_raw$person)
+ all_data <- rbind(all_data, new_data)
+
+ #get following pages if there are any
+ page <- page + 1
- return(m)
+ type <- paste("teams/", id, "/commit-tags/?format=json&per_page=5000&page=", page, sep = "")
+ url <- paste(baseurl, type, sep = "")
+ url_status <- url.exists(url)
+ if (!url_status) break
+ }
+
+ return(all_data)
}
get_signed <- function (df){