contrib/rss_download: add a sample configuration
authorAlexis Laferrière <alexis.laf@xymus.net>
Mon, 8 Dec 2014 02:45:49 +0000 (21:45 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Sun, 14 Dec 2014 21:08:38 +0000 (16:08 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/rss_downloader/src/sample_config.nit [new file with mode: 0644]

diff --git a/contrib/rss_downloader/src/sample_config.nit b/contrib/rss_downloader/src/sample_config.nit
new file mode 100644 (file)
index 0000000..c9f362e
--- /dev/null
@@ -0,0 +1,44 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import rss_downloader
+
+# Current user's home directory
+fun home: String do return "HOME".environ
+
+redef fun tool_config do return new Config(
+       # Source folders
+       ["{home}/Downloads/".to_path],
+
+       # Custom patterns
+       ["S01E01",
+        "1x01",
+        "pilot"], # We use Strings here, but we could also use a `Regex`
+
+       # Destination folder
+       "{home}/Downloads/".to_path,
+
+       # RSS feeds
+       ["http://example.org/feed.rss"],
+
+       # Log file
+       "{home}/rss_downloader.log".to_path,
+
+       # Uniqueness patterns
+       ["S[0-9]+E[0-9]+".to_re, # S01E01
+        "[0-9]+x[0-9]+".to_re,  # 1x01
+        "[0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]".to_re], # 1970.01.01
+
+       # Uniqueness exceptions
+       ["repack"])