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: content/collections/tutorials/create-collection.md
+74-2Lines changed: 74 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,14 +7,86 @@ weight: 1
7
7
8
8
This tutorial will guide you through creating your first Open Terms Archive collection.
9
9
10
-
By the end, you'll have a working collection that tracks changes to a service's privacy policy. You will also have a basic understanding of how to create a collection and how to set up the API.
10
+
By the end, you'll have a working collection that tracks changes to a service's privacy policy. You will also have a basic understanding of how to create a collection.
11
11
12
12
## Prerequisites
13
13
14
14
- Node.js installed on your system
15
15
- Basic familiarity with the command line
16
16
- A text editor
17
17
18
-
## Track a terms
18
+
## Create a collection
19
19
20
20
### Step 1: Set up the project structure
21
+
22
+
1. Create a new directory:
23
+
```bash
24
+
mkdir ota-tutorial-declarations
25
+
cd ota-tutorial-declarations
26
+
```
27
+
28
+
2. Create a `declarations` directory inside the project. This is where you will declare the service and terms you want to track:
29
+
```bash
30
+
mkdir declarations
31
+
```
32
+
33
+
3. Create the configuration file for the collection:
34
+
```bash
35
+
mkdir config
36
+
```
37
+
38
+
### Step 2: Create the service declaration
39
+
40
+
4. Create a file `declarations/Open Terms Archive.js` with the basic structure, the first thing to declare is the service name:
tagline: Learn how to create an Open Terms Archive collection
60
+
description: |
61
+
A step-by-step tutorial collection that guides through creating an Open Terms Archive collection.
62
+
Track terms and conditions from websites while learning the basics of declarations, configuration, and metadata.
63
+
languages: [en]
64
+
jurisdictions: [EU]
65
+
```
66
+
67
+
### Step 3: Create the configuration file
68
+
69
+
5. Create a file `config/development.json` and set the tracking schedule to every minute:
70
+
```json
71
+
{
72
+
"trackingSchedule": "* * * * *"
73
+
}
74
+
```
75
+
76
+
### Step 4: Install and run the engine
77
+
78
+
1. Install the Open Terms Archive engine:
79
+
```bash
80
+
npm install --save @opentermsarchive/engine
81
+
```
82
+
83
+
2. Start the scheduled tracking of the declared terms:
84
+
```bash
85
+
npx ota track --schedule
86
+
```
87
+
88
+
3. After one minute, check the results:
89
+
- Check the extracted version, which should contain the Privacy Policy of Open Terms Archive in the markdown format without insignificant content (like the header, footer, etc.): `./data/versions/Open Terms Archive/Privacy Policy.md`
90
+
- Check the snapshot, which is the original html document of the Open Terms Archive Privacy Policy: `./data/snapshots/Open Terms Archive/Privacy Policy.html`
91
+
92
+
Congratulations! You have created your first collection.
Copy file name to clipboardExpand all lines: content/terms/tutorials/track-terms.md
+45-39Lines changed: 45 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ weight: 1
5
5
6
6
# Track your first terms
7
7
8
-
This tutorial will guide you through creating your first Open Terms Archive collection.
8
+
This tutorial will guide you through tracking your first terms.
9
9
10
-
By the end, you'll have a working collection that tracks changes to a service's privacy policy. You will also have a basic understanding of how to create a collection and how to set up the API.
10
+
By the end, you'll have tracked a service's privacy policy. You will also have a basic understanding of how to declare a terms to track and how to run the engine.
11
11
12
12
## Prerequisites
13
13
@@ -17,57 +17,63 @@ By the end, you'll have a working collection that tracks changes to a service's
17
17
18
18
## Track a terms
19
19
20
-
### Step 1: Set up the project structure
20
+
### Step 1: Set up the structure
21
21
22
-
1. Create a new directory for your collection:
23
-
```bash
24
-
mkdir ota-tutorial-declarations
25
-
cd ota-tutorial-declarations
26
-
```
22
+
1. Create a new directory:
23
+
```bash
24
+
mkdir ota-tutorial-declarations
25
+
cd ota-tutorial-declarations
26
+
```
27
27
28
-
2. Create a `declarations` directory inside your project. This is where you will declare the services and terms you want to track:
29
-
```bash
30
-
mkdir declarations
31
-
```
28
+
2. Create a `declarations` directory inside the project. This is where you will declare the service and terms you want to track:
29
+
```bash
30
+
mkdir declarations
31
+
```
32
32
33
-
### Step 2: Create your first service declaration
33
+
### Step 2: Create the service declaration
34
34
35
35
For this tutorial, we will use the Privacy Policy of Open Terms Archive as an example.
36
-
1. Create a file `declarations/Open Terms Archive.js` with this basic structure, the first thing to declare is the service name:
37
-
```json
38
-
{
39
-
"name": "Open Terms Archive"
40
-
}
41
-
```
42
36
43
-
Now, you can add a terms you want to track to the declaration. For this example, we will use the Privacy Policy of Open Terms Archive.
37
+
1. Create a file `declarations/Open Terms Archive.js` with the basic structure, the first thing to declare is the service name:
38
+
```json
39
+
{
40
+
"name": "Open Terms Archive"
41
+
}
42
+
```
43
+
44
+
Now, you can add a terms you want to track to the declaration. For this example, we will use the Privacy Policy of Open Terms Archive.
45
+
46
+
You can go on the open terms archive website and copy the URL of the Privacy Policy to fill the `fetch` field.
47
+
48
+
And you can inspect the HTML of the page to get the selector of the content you want to extract to fill the `select` field.
2. Start a one time tracking of the declared terms:
66
-
```bash
67
-
npx ota track
68
-
```
71
+
```bash
72
+
npx ota track
73
+
```
69
74
70
75
3. Verify the results:
71
-
- Check the extracted version, which should contain the Privacy Policy of Open Terms Archive in the markdown format without insignificant content (like the header, footer, etc.): `./data/versions/Open Terms Archive/Privacy Policy.md`
72
-
- Check the snapshot, which is the original html document of the Open Terms Archive Privacy Policy: `./data/snapshots/Open Terms Archive/Privacy Policy.html`
76
+
- Check the extracted version, which should contain the Privacy Policy of Open Terms Archive in the markdown format without insignificant content (like the header, footer, etc.): `./data/versions/Open Terms Archive/Privacy Policy.md`
77
+
- Check the snapshot, which is the original html document of the Open Terms Archive Privacy Policy: `./data/snapshots/Open Terms Archive/Privacy Policy.html`
73
78
79
+
Congratulations! You have tracked your first terms.
0 commit comments