summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/news.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
committermakefu <github@syntax-fehler.de>2021-02-11 14:06:45 +0100
commit540e13721d85dcf100bf3529414d96cd8e28a446 (patch)
tree7db6b3955f8f06af83434027e4825f8b160ba9d4 /krebs/2configs/news.nix
parent38bddfd404b4418b4e820dfbd312145fc6abca68 (diff)
parentd0e7bc46b4cdb15f7505aa069ac29588b02ddf92 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/2configs/news.nix')
-rw-r--r--krebs/2configs/news.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/krebs/2configs/news.nix b/krebs/2configs/news.nix
index 3bf991433..ce4e83408 100644
--- a/krebs/2configs/news.nix
+++ b/krebs/2configs/news.nix
@@ -39,10 +39,12 @@
};
};
- krebs.reaktor2.news = {
+ krebs.reaktor2.news = let
+ name = "candyman";
+ in {
hostname = "localhost";
port = "6667";
- nick = "brockman-helper";
+ nick = name;
plugins = [
{
plugin = "register";
@@ -60,23 +62,23 @@
hooks.PRIVMSG = [
{
activate = "match";
- pattern = "^brockman-helper:\\s*(\\S*)(?:\\s+(.*\\S))?\\s*$";
+ pattern = "^${name}:\\s*(\\S*)(?:\\s+(.*\\S))?\\s*$";
command = 1;
arguments = [2];
commands = {
add-reddit.filename = pkgs.writeDash "add-reddit" ''
set -euf
if [ "$#" -ne 1 ]; then
- echo 'usage: brockman-helper: add-reddit $reddit_channel'
+ echo 'usage: ${name}: add-reddit $reddit_channel'
exit 1
fi
reddit_channel=$(echo "$1" | ${pkgs.jq}/bin/jq -Rr '[match("(\\S+)\\s*";"g").captures[].string][0]')
- echo "brockman: add r_$reddit_channel http://rss.r/?action=display&bridge=Telegram&username=$reddit_channel&format=Mrss"
+ echo "brockman: add r_$reddit_channel http://rss.r/?action=display&bridge=Reddit&context=single&r=$reddit_channel&format=Atom"
'';
add-telegram.filename = pkgs.writeDash "add-telegram" ''
set -euf
if [ "$#" -ne 1 ]; then
- echo 'usage: brockman-helper: add-telegram $telegram_user'
+ echo 'usage: ${name}: add-telegram $telegram_user'
exit 1
fi
telegram_user=$(echo "$1" | ${pkgs.jq}/bin/jq -Rr '[match("(\\S+)\\s*";"g").captures[].string][0]')
@@ -85,7 +87,7 @@
add-youtube.filename = pkgs.writeDash "add-youtube" ''
set -euf
if [ "$#" -ne 1 ]; then
- echo 'usage: brockman-helper: add-youtube $nick $channelid'
+ echo 'usage: ${name}: add-youtube $nick $channelid'
exit 1
fi
youtube_nick=$(echo "$1" | ${pkgs.jq}/bin/jq -Rr '[match("(\\S+)\\s*";"g").captures[].string][0]')
@@ -95,7 +97,7 @@
search.filename = pkgs.writeDash "search" ''
set -euf
if [ "$#" -ne 1 ]; then
- echo 'usage: brockman-helper: search $searchterm'
+ echo 'usage: ${name}: search $searchterm'
exit 1
fi
searchterm=$(echo "$1" | ${pkgs.jq}/bin/jq -Rr '[match("(\\S+)\\s*";"g").captures[].string][0]')