Adapt demos to simplified authorization
Change-Id: If29075378f77cc8872cbf59c3e3d92fe39b84fb6
diff --git a/demo/displayKwics.R b/demo/displayKwics.R
index 4da6540..cab5807 100644
--- a/demo/displayKwics.R
+++ b/demo/displayKwics.R
@@ -1,24 +1,17 @@
library(RKorAPClient)
-library(httr)
library(kableExtra)
library(dplyr)
query = 'V\u00F6ner' # "Portable packages must use only ASCII characters in their demos."
-korap_app <-oauth_app("test-korap-client", key = "773NHGM76N7P9b6rLfmpM4", secret = NULL)
-korap_endpoint <- oauth_endpoint(NULL,
- "settings/oauth/authorize",
- "api/v1.0/oauth2/token",
- base_url = "https://korap.ids-mannheim.de")
-token_bundle = oauth2.0_token(korap_endpoint, korap_app, scope = "search match_info", cache = FALSE)
-
-new("KorAPConnection", verbose = TRUE, accessToken = token_bundle[["credentials"]][["access_token"]]) %>%
+new("KorAPConnection", verbose = TRUE) %>%
+ auth() %>%
corpusQuery(query, fields = c("textSigle", "pubDate", "corpusTitle", "snippet"),
metadataOnly = FALSE) %>%
fetchAll() %>%
slot("collectedMatches") %>%
dplyr::arrange(pubDate) %>%
dplyr::rename("kwic" = "snippet") %>%
- kable(escape = FALSE, caption = paste0("Query hits for '", query, "' ordered by date of publication")) %>%
+ kable(format = "html", escape = FALSE, caption = paste0("Query hits for '", query, "' ordered by date of publication")) %>%
kable_styling() %>%
print()