This tutorial will guide you through tracking your first terms.
By the end, you’ll have tracked a service’s privacy policy. You will also have a basic understanding of how to run the engine to track terms.
Create a new directory:
mkdir ota-tutorial-declarations
cd ota-tutorial-declarations
Create a declarations
directory inside the project. This is where you will declare the service and terms you want to track:
mkdir declarations
For this tutorial, we will use the Privacy Policy of Open Terms Archive as an example.
Create a file declarations/Open Terms Archive.json
. The name of the file is the name of the service that will be tracked. The first thing to declare is the tracked service name:
{
"name": "Open Terms Archive"
}
Find the URL of Open Terms Archive Privacy Policy by browsing the website, copy the URL and fill the fetch
field with.
{
"name": "Open Terms Archive",
"terms": {
"Privacy Policy": {
"fetch": "https://opentermsarchive.org/en/privacy-policy"
}
}
}
Use a DOM inspector on the Open Terms Archive Privacy Policy page to get the CSS selector of the content you want to extract. Add it to the select
field. The final declaration should look like this:
{
"name": "Open Terms Archive",
"terms": {
"Privacy Policy": {
"fetch": "https://opentermsarchive.org/en/privacy-policy",
"select": ".textcontent"
}
}
}
Install the Open Terms Archive engine:
npm install --save @opentermsarchive/engine
Start a one time tracking of the declared terms:
npx ota track
Verify the results by checking the extracted version in ./data/versions/Open Terms Archive/Privacy Policy.md
file, which should contain only the meaningful content of the Privacy Policy in Markdown format.
Congratulations! You have tracked your first terms locally.