diff --git a/krebs/5pkgs/Reaktor/plugins.nix b/krebs/5pkgs/Reaktor/plugins.nix index a483db32c..3e48ae3ba 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 = "^.*(?Phttp[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 /\s*(.*?)(?: - youtube)?\s*<\/title/si' + fi + ''; + }); + }