1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "texts": [
12 "Default QA 1: please hide this shit before export.",
13 "Default QA 2: clean text without blocked words.",
14 "Default QA 3: this damn message is allowed to mask, but damnation stays safe.",
15 "Default QA 4: clean text without blocked words.",
16 "Default QA 5: spoiler should be caught by custom words.",
17 "Default QA 6: this damn message is allowed to mask, but damnation stays safe.",
18 "Default QA 7: please hide this shit before export.",
19 "Default QA 8: clean text without blocked words.",
20 "Default QA 9: this damn message is allowed to mask, but damnation stays safe.",
21 "Default QA 10: spoiler should be caught by custom words.",
22 "Default QA 11: please hide this shit before export.",
23 "Default QA 12: this damn message is allowed to mask, but damnation stays safe.",
24 "Default QA 13: please hide this shit before export.",
25 "Default QA 14: clean text without blocked words.",
26 "Default QA 15: spoiler should be caught by custom words.",
27 "Default QA 16: clean text without blocked words.",
28 "Default QA 17: please hide this shit before export.",
29 "Default QA 18: this damn message is allowed to mask, but damnation stays safe.",
30 "Default QA 19: please hide this shit before export.",
31 "Default QA 20: spoiler should be caught by custom words.",
32 "Default QA 21: this damn message is allowed to mask, but damnation stays safe.",
33 "Default QA 22: clean text without blocked words.",
34 "Default QA 23: please hide this shit before export.",
35 "Default QA 24: this damn message is allowed to mask, but damnation stays safe.",
36 "Default QA 25: spoiler should be caught by custom words."
37 ],
38 "customWords": [
39 "spoiler"
40 ],
41 "allowedWords": [
42 "damnation"
43 ]
44};
45
46
47const run = await client.actor("maximedupre/profanity-checker").call(input);
48
49
50console.log('Results from dataset');
51console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
52const { items } = await client.dataset(run.defaultDatasetId).listItems();
53items.forEach((item) => {
54 console.dir(item);
55});
56
57