aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--copyright2
-rw-r--r--example/README.txt4
-rw-r--r--example/content/bhello_ap/index.json7
-rw-r--r--example/content/bhello_ap_cu/index.json8
-rw-r--r--example/content/bhello_cu/index.json7
-rw-r--r--example/content/bhello_pe/index.json7
-rw-r--r--example/content/bhello_pe_pi/index.json8
-rw-r--r--example/content/bhello_pi/index.json7
-rw-r--r--example/content/phachettebugs1/index.json5
-rw-r--r--example/content/phachettebugs2/index.json5
-rw-r--r--example/content/phachettebugs3/index.json5
-rw-r--r--example/content/phachettebugs4/index.json5
-rw-r--r--example/content/pkoszko.org_hello1/index.json5
-rw-r--r--example/content/pkoszko.org_hello2/index.json5
-rw-r--r--example/content/pkoszko.org_hello3/index.json5
-rw-r--r--example/content/pmyfsfhello1/index.json5
-rw-r--r--example/content/pmyfsfhello2/index.json5
-rw-r--r--example/content/pmyfsfhello3/index.json5
-rw-r--r--example/content/shello_apple/hello.js1
-rw-r--r--example/content/shello_apple/index.json6
-rw-r--r--example/content/shello_cucumber/hello.js1
-rw-r--r--example/content/shello_cucumber/index.json6
-rw-r--r--example/content/shello_pear/hello.js1
-rw-r--r--example/content/shello_pear/index.json6
-rw-r--r--example/content/shello_pineapple/hello.js1
-rw-r--r--example/content/shello_pineapple/index.json6
-rw-r--r--tests/README.txt3
-rw-r--r--tests/content/bhello/index.json9
-rw-r--r--tests/content/pmyfsfhello/index.json5
-rw-r--r--tests/content/sbad/index.json1
-rw-r--r--tests/content/sgood/good.js1
-rw-r--r--tests/content/sgood/index.json6
32 files changed, 152 insertions, 1 deletions
diff --git a/copyright b/copyright
index 6ba447d..b17692d 100644
--- a/copyright
+++ b/copyright
@@ -11,7 +11,7 @@ Copyright: 2021 Wojtek Kosior <koszko@koszko.org>
2008-2010, 2012 Christian Grothoff
License: AGPL-3+ or Alicense-1.0, and public-domain
-Files: Makefile README.txt copyright
+Files: Makefile README.txt copyright examples/* tests/*
Copyright: 2021 Wojtek Kosior <koszko@koszko.org>
License: CC0
diff --git a/example/README.txt b/example/README.txt
new file mode 100644
index 0000000..bbc1bca
--- /dev/null
+++ b/example/README.txt
@@ -0,0 +1,4 @@
+This directory contains example resources for Hydrilla. They do not do anything
+useful - just print some kind of "hello" message on given websites. They are
+meant for use as a reference for data format and as a mock of real resources
+for use whene developing.
diff --git a/example/content/bhello_ap/index.json b/example/content/bhello_ap/index.json
new file mode 100644
index 0000000..2552c31
--- /dev/null
+++ b/example/content/bhello_ap/index.json
@@ -0,0 +1,7 @@
+{
+"type" : "bag",
+"name" : "hello_apple",
+"components" : [
+["script", "hello_apple"]
+]
+}
diff --git a/example/content/bhello_ap_cu/index.json b/example/content/bhello_ap_cu/index.json
new file mode 100644
index 0000000..5f093e7
--- /dev/null
+++ b/example/content/bhello_ap_cu/index.json
@@ -0,0 +1,8 @@
+{
+"type" : "bag",
+"name" : "hello_apple_and_cucumber",
+"components" : [
+["bag", "hello_apple"],
+["bag", "hello_cucumber"]
+]
+}
diff --git a/example/content/bhello_cu/index.json b/example/content/bhello_cu/index.json
new file mode 100644
index 0000000..47023ca
--- /dev/null
+++ b/example/content/bhello_cu/index.json
@@ -0,0 +1,7 @@
+{
+"type" : "bag",
+"name" : "hello_cucumber",
+"components" : [
+["script", "hello_cucumber"]
+]
+}
diff --git a/example/content/bhello_pe/index.json b/example/content/bhello_pe/index.json
new file mode 100644
index 0000000..07de71a
--- /dev/null
+++ b/example/content/bhello_pe/index.json
@@ -0,0 +1,7 @@
+{
+"type" : "bag",
+"name" : "hello_pear",
+"components" : [
+["script", "hello_pear"]
+]
+}
diff --git a/example/content/bhello_pe_pi/index.json b/example/content/bhello_pe_pi/index.json
new file mode 100644
index 0000000..5ceff86
--- /dev/null
+++ b/example/content/bhello_pe_pi/index.json
@@ -0,0 +1,8 @@
+{
+"type" : "bag",
+"name" : "hello_pear_and_pineapple",
+"components" : [
+["bag", "hello_pear"],
+["bag", "hello_pineapple"]
+]
+}
diff --git a/example/content/bhello_pi/index.json b/example/content/bhello_pi/index.json
new file mode 100644
index 0000000..8e6946e
--- /dev/null
+++ b/example/content/bhello_pi/index.json
@@ -0,0 +1,7 @@
+{
+"type" : "bag",
+"name" : "hello_pineapple",
+"components" : [
+["script", "hello_pineapple"]
+]
+}
diff --git a/example/content/phachettebugs1/index.json b/example/content/phachettebugs1/index.json
new file mode 100644
index 0000000..fac24ef
--- /dev/null
+++ b/example/content/phachettebugs1/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://*.koszko.org/***",
+"payload" : ["script", "hello_pear"]
+}
diff --git a/example/content/phachettebugs2/index.json b/example/content/phachettebugs2/index.json
new file mode 100644
index 0000000..891f0d2
--- /dev/null
+++ b/example/content/phachettebugs2/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://hachettebugs.koszko.org/**",
+"payload" : ["bag", "hello_pear"]
+}
diff --git a/example/content/phachettebugs3/index.json b/example/content/phachettebugs3/index.json
new file mode 100644
index 0000000..7187af5
--- /dev/null
+++ b/example/content/phachettebugs3/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://hachettebugs.koszko.org/boards/***",
+"payload" : ["bag", "hello_cucumber"]
+}
diff --git a/example/content/phachettebugs4/index.json b/example/content/phachettebugs4/index.json
new file mode 100644
index 0000000..203153a
--- /dev/null
+++ b/example/content/phachettebugs4/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://hachettebugs.koszko.org/projects/***",
+"payload" : ["bag", "hello_pineapple"]
+}
diff --git a/example/content/pkoszko.org_hello1/index.json b/example/content/pkoszko.org_hello1/index.json
new file mode 100644
index 0000000..013ce7c
--- /dev/null
+++ b/example/content/pkoszko.org_hello1/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://koszko.org/en/",
+"payload" : ["bag", "hello_apple_and_cucumber"]
+}
diff --git a/example/content/pkoszko.org_hello2/index.json b/example/content/pkoszko.org_hello2/index.json
new file mode 100644
index 0000000..a61f7e6
--- /dev/null
+++ b/example/content/pkoszko.org_hello2/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://koszko.org/**",
+"payload" : ["bag", "hello_cucumber"]
+}
diff --git a/example/content/pkoszko.org_hello3/index.json b/example/content/pkoszko.org_hello3/index.json
new file mode 100644
index 0000000..d0e00d0
--- /dev/null
+++ b/example/content/pkoszko.org_hello3/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://koszko.org/***",
+"payload" : ["bag", "hello_pear_and_pineapple"]
+}
diff --git a/example/content/pmyfsfhello1/index.json b/example/content/pmyfsfhello1/index.json
new file mode 100644
index 0000000..d151f1b
--- /dev/null
+++ b/example/content/pmyfsfhello1/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://my.fsf.org",
+"payload" : ["bag", "hello_apple"]
+}
diff --git a/example/content/pmyfsfhello2/index.json b/example/content/pmyfsfhello2/index.json
new file mode 100644
index 0000000..2bd0be3
--- /dev/null
+++ b/example/content/pmyfsfhello2/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://my.fsf.org/",
+"payload" : ["script", "hello_apple"]
+}
diff --git a/example/content/pmyfsfhello3/index.json b/example/content/pmyfsfhello3/index.json
new file mode 100644
index 0000000..ba0a126
--- /dev/null
+++ b/example/content/pmyfsfhello3/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://*.fsf.org/",
+"payload" : ["bag", "hello_pineapple"]
+}
diff --git a/example/content/shello_apple/hello.js b/example/content/shello_apple/hello.js
new file mode 100644
index 0000000..b6b1a02
--- /dev/null
+++ b/example/content/shello_apple/hello.js
@@ -0,0 +1 @@
+console.log("hello, apple!");
diff --git a/example/content/shello_apple/index.json b/example/content/shello_apple/index.json
new file mode 100644
index 0000000..c52c32c
--- /dev/null
+++ b/example/content/shello_apple/index.json
@@ -0,0 +1,6 @@
+{
+"type" : "script",
+"name" : "hello_apple",
+"sha256" : "d349309ba674c092a7d03cd5ecc90c6370402482286db28b3d32d86052b6cf69",
+"location" : "hello.js"
+}
diff --git a/example/content/shello_cucumber/hello.js b/example/content/shello_cucumber/hello.js
new file mode 100644
index 0000000..b285094
--- /dev/null
+++ b/example/content/shello_cucumber/hello.js
@@ -0,0 +1 @@
+console.log("hello, cucumber!");
diff --git a/example/content/shello_cucumber/index.json b/example/content/shello_cucumber/index.json
new file mode 100644
index 0000000..788d51e
--- /dev/null
+++ b/example/content/shello_cucumber/index.json
@@ -0,0 +1,6 @@
+{
+"type" : "script",
+"name" : "hello_cucumber",
+"sha256" : "1d65dda24c08e928cfd06a98b57def4599ff4cfe85e01e517d852a87feb03111",
+"location" : "hello.js"
+}
diff --git a/example/content/shello_pear/hello.js b/example/content/shello_pear/hello.js
new file mode 100644
index 0000000..0e98fdd
--- /dev/null
+++ b/example/content/shello_pear/hello.js
@@ -0,0 +1 @@
+console.log("hello, pear!");
diff --git a/example/content/shello_pear/index.json b/example/content/shello_pear/index.json
new file mode 100644
index 0000000..65d8d61
--- /dev/null
+++ b/example/content/shello_pear/index.json
@@ -0,0 +1,6 @@
+{
+"type" : "script",
+"name" : "hello_pear",
+"sha256" : "f61c50e1b977235260ee8b708b31ee003b1585afbe228cee6a0d754357e24b7e",
+"location" : "hello.js"
+}
diff --git a/example/content/shello_pineapple/hello.js b/example/content/shello_pineapple/hello.js
new file mode 100644
index 0000000..3632e67
--- /dev/null
+++ b/example/content/shello_pineapple/hello.js
@@ -0,0 +1 @@
+console.log("hello, pineapple!");
diff --git a/example/content/shello_pineapple/index.json b/example/content/shello_pineapple/index.json
new file mode 100644
index 0000000..f75935a
--- /dev/null
+++ b/example/content/shello_pineapple/index.json
@@ -0,0 +1,6 @@
+{
+"type" : "script",
+"name" : "hello_pineapple",
+"sha256" : "f53bde306e0774618a1c9e12cb62175fbca90779c79d812a699b54c125c1634a",
+"location" : "hello.js"
+}
diff --git a/tests/README.txt b/tests/README.txt
new file mode 100644
index 0000000..e728f79
--- /dev/null
+++ b/tests/README.txt
@@ -0,0 +1,3 @@
+In the future this directory will contain test cases for Hydrilla.
+For now there is only a directory of example contents directory with
+some broken resources.
diff --git a/tests/content/bhello/index.json b/tests/content/bhello/index.json
new file mode 100644
index 0000000..510499c
--- /dev/null
+++ b/tests/content/bhello/index.json
@@ -0,0 +1,9 @@
+{
+"type" : "bag",
+"name" : "hello",
+"components" : [
+["script", "good"],
+["script", "absent"],
+["bag", "absent"]
+]
+}
diff --git a/tests/content/pmyfsfhello/index.json b/tests/content/pmyfsfhello/index.json
new file mode 100644
index 0000000..c1685f5
--- /dev/null
+++ b/tests/content/pmyfsfhello/index.json
@@ -0,0 +1,5 @@
+{
+"type" : "page",
+"pattern" : "https://my.fsf.org",
+"payload" : ["bag", "hello"]
+}
diff --git a/tests/content/sbad/index.json b/tests/content/sbad/index.json
new file mode 100644
index 0000000..3495c02
--- /dev/null
+++ b/tests/content/sbad/index.json
@@ -0,0 +1 @@
+{)'fwe;32{]}
diff --git a/tests/content/sgood/good.js b/tests/content/sgood/good.js
new file mode 100644
index 0000000..def45e3
--- /dev/null
+++ b/tests/content/sgood/good.js
@@ -0,0 +1 @@
+console.log("good hello!");
diff --git a/tests/content/sgood/index.json b/tests/content/sgood/index.json
new file mode 100644
index 0000000..cd44109
--- /dev/null
+++ b/tests/content/sgood/index.json
@@ -0,0 +1,6 @@
+{
+"type" : "script",
+"name" : "good",
+"sha256" : "e4dbe4dba40e8bd159fb987b0f0cf2c243d7e6b9b9dc792e58dedf1fae38b0a1",
+"location" : "good.js"
+}