You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/r/wiley-tdm.md
+35-18Lines changed: 35 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: "wiley-tdm"
2
+
title: "Wiley Text and Data Mining (TDM) in R"
3
3
output:
4
4
html_document:
5
5
keep_md: true
@@ -9,26 +9,32 @@ output:
9
9
10
10
by Michael T. Moen
11
11
12
-
This tutorial is designed to support academic research. Please consult your institution’s library or legal office regarding its Text and Data Mining license agreement with Wiley.
12
+
The Wiley Text and Data Mining (TDM) API allows users to retrieve the full-text articles of subscribed Wiley content in PDF form. TDM use is for non-commercial scholarly research, see terms and restrictions in below links.
13
13
14
-
### Documentation
15
-
-[Wiley Text and Data Mining](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining)
14
+
*This tutorial content is intended to help facilitate academic research. Please check your institution for their Text and Data Mining or related License Agreement with Wiley.*
16
15
17
-
### Terms of Use
18
-
-[Wiley Text and Data Mining Agreement](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining#accordionHeader-3)
16
+
Please see the following resources for more information on API usage:
19
17
20
-
### Data Reuse
21
-
-[Service Name] Data Reuse *(link to be provided by the service)*
18
+
- Documentation
19
+
- <ahref="https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining"target="_blank">Wiley Text and Data Mining</a>
20
+
- Terms
21
+
- <ahref="https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining#accordionHeader-3"target="_blank">Wiley Text and Data Mining Agreement</a>
22
+
- Data Reuse
23
+
- <ahref="https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining#accordionHeader-3"target="_blank">Wiley TDM Data Reuse</a> (see sections 4 and 5 of Text and Data Mining Agreement)
22
24
23
-
*These recipe examples were tested on February 12, 2025.*
25
+
*These recipe examples were tested on October 27, 2025.*
24
26
25
27
**_NOTE:_** The Wiley TDM API limits requests to a maximum of 3 requests per second.
26
28
27
29
## Setup
28
30
29
31
### Import Libraries
30
32
31
-
This tutorial uses the following libraries:
33
+
The following packages need to be installed into your environment to run the code examples in this tutorial. These packages can be installed with `install.packages()`.
34
+
35
+
- <ahref="https://cran.r-project.org/web/packages/httr/index.html"target="_blank">httr: Tools for Working with URLs and HTTP</a>
36
+
37
+
We load the libraries used in this tutorial below:
32
38
33
39
34
40
```r
@@ -37,14 +43,27 @@ library(httr)
37
43
38
44
### Text and Data Mining Token
39
45
40
-
A token is required to access the Wiley TDM API. Sign up can be found [here](https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining#accordionHeader-2). Import your token below:
46
+
A token is required for text and data mining with Wiley. You can sign up for one on the <ahref="https://onlinelibrary.wiley.com/library-info/resources/text-and-datamining#accordionHeader-2"target="_blank">Wiley Text and Data Mining page</a>.
47
+
48
+
We keep our token in a `.Renviron` file that is stored in the working directory and use `Sys.getenv()` to access it. The `.Renviron` should have an entry like the one below.
49
+
50
+
```text
51
+
WILEY_TDM_TOKEN="PUT_YOUR_TOKEN_HERE"
52
+
```
53
+
54
+
Below, we can test to whether the key was successfully imported.
41
55
42
56
43
57
```r
44
-
wiley_token<- Sys.getenv("wiley_token")
58
+
if (nzchar(Sys.getenv("WILEY_TDM_TOKEN"))) {
59
+
print("API key successfully loaded.")
60
+
} else {
61
+
warning("API key not found or is empty.")
62
+
}
63
+
```
45
64
46
-
# The token will be sent as a header in the API calls
0 commit comments