summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/Reaktor/plugins.nix
diff options
context:
space:
mode:
Diffstat (limited to 'krebs/5pkgs/Reaktor/plugins.nix')
-rw-r--r--krebs/5pkgs/Reaktor/plugins.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/krebs/5pkgs/Reaktor/plugins.nix b/krebs/5pkgs/Reaktor/plugins.nix
index a483db32..3e48ae3b 100644
--- a/krebs/5pkgs/Reaktor/plugins.nix
+++ b/krebs/5pkgs/Reaktor/plugins.nix
@@ -116,4 +116,16 @@ rec {
commands.insert(0,titlebot_cmd('clear'))
'';
};
+
+ url-title = (buildSimpleReaktorPlugin "url-title" {
+ pattern = "^.*(?P<args>http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)$$";
+ path = with pkgs; [ wget perl ];
+ script = pkgs.writeDash "lambda-pl" ''
+ if [ "$#" -gt 0 ]; then
+ exec wget -qO- "$1" |
+ perl -l -0777 -ne 'print $1 if /<title.*?>\s*(.*?)(?: - youtube)?\s*<\/title/si'
+ fi
+ '';
+ });
+
}