mirror of
https://github.com/kmein/niveum
synced 2026-03-18 19:11:08 +01:00
Compare commits
3 Commits
e34aecaa66
...
99a8ecf876
| Author | SHA1 | Date | |
|---|---|---|---|
| 99a8ecf876 | |||
| 6a3add22ed | |||
| 83fb13d541 |
@@ -24,6 +24,7 @@ in {
|
||||
./autorenkalender.nix
|
||||
./proverb.nix
|
||||
./nachtischsatan.nix
|
||||
./tlg-wotd.nix
|
||||
<niveum/modules/telegram-bot.nix>
|
||||
];
|
||||
|
||||
|
||||
17
configs/telegram-bots/tlg-wotd.nix
Normal file
17
configs/telegram-bots/tlg-wotd.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
niveum.telegramBots.tlg-wotd = {
|
||||
enable = true;
|
||||
time = "9:30";
|
||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||
chatIds = [ "@tlgwotd" ];
|
||||
command = toString (pkgs.writers.writeDash "tlg-wotd" ''
|
||||
${pkgs.curl}/bin/curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd \
|
||||
| ${pkgs.recode}/bin/recode html..utf8 \
|
||||
| ${pkgs.jq}/bin/jq -r '
|
||||
"*\(.word)* '\'''\(.definition | rtrimstr(" "))'\'''\n\nFirst occurrence: \(.firstOccurrence)\nNumber of occurrences: \(.totalOccurrences)"
|
||||
'
|
||||
'');
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
}
|
||||
@@ -315,7 +315,7 @@ in rec {
|
||||
};
|
||||
streams-tsv = pkgs.writeText "streams.tsv" (lib.concatMapStringsSep "\n" ({ desc ? "", stream, station, ... }: "${station}\t${desc}\t${stream}") streams);
|
||||
in pkgs.writers.writeDashBin "mpv-radio" ''
|
||||
exec ${pkgs.mpv}/bin/mpv "$(${pkgs.fzf}/bin/fzf < ${streams-tsv} | ${pkgs.coreutils}/bin/cut -f3)"
|
||||
exec ${pkgs.mpv}/bin/mpv --force-window=yes "$(${pkgs.dmenu}/bin/dmenu -i -l 5 < ${streams-tsv} | ${pkgs.coreutils}/bin/cut -f3)"
|
||||
'';
|
||||
|
||||
rfc = wrapScript {
|
||||
|
||||
Reference in New Issue
Block a user