X-Git-Url: https://git.wikimedia.ca/?a=blobdiff_plain;f=eccc_to_commons.sh;fp=eccc_to_commons.sh;h=c580fbbc6518c99ba474e034e8887a7b9b7c1386;hb=86faa15d147318dbfdabdaf1d04efb8a59ff7051;hp=0000000000000000000000000000000000000000;hpb=d5920c8c99f839f2081236b0174717f0fb40d885;p=eccc_to_commons.git
diff --git a/eccc_to_commons.sh b/eccc_to_commons.sh
new file mode 100755
index 0000000..c580fbb
--- /dev/null
+++ b/eccc_to_commons.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+# eccc_to_commons - Batch convert Environment and Climate change Canada
+# historical XML data into a JSON format suitable for
+# Wikimedia Commons.
+# Copyright (C) 2019-2020 Pierre Choffet
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+
+set -e
+
+SOURCE="${1}"
+DESTINATION="${2}"
+
+if [ -z "${SOURCE}" ]||[ -z "${DESTINATION}" ]||[ ! -d "${DESTINATION}" ]
+then
+ echo 'Fix XMLs provided by Environment and Climate change Canada'
+ echo 'Usage: eccc_to_commons.sh