1
0
mirror of https://github.com/kmein/niveum synced 2026-03-22 04:41:07 +01:00

6 Commits

11 changed files with 39 additions and 17 deletions

View File

@@ -11,8 +11,8 @@
inherit (import ../../lib) tmpfilesConfig;
in {
imports = [
./literature-quote.nix
./astrology.nix
./logotheca.nix
./transits.nix
./autorenkalender.nix
./hesychius.nix
./smyth.nix

View File

@@ -11,9 +11,9 @@ in {
enable = true;
time = "08:00";
mastodon = {
enable = false;
enable = true;
language = "el";
tokenFile = config.age.secrets.mastodon-token-smyth.path;
tokenFile = config.age.secrets.mastodon-token-hesychius.path;
};
telegram = {
enable = true;

View File

@@ -5,7 +5,7 @@
niveumPackages,
...
}: {
niveum.bots.quotebot = {
niveum.bots.logotheca = {
enable = true;
time = "08/6:00";
telegram = {

View File

@@ -8,9 +8,9 @@
enable = true;
time = "08:00";
mastodon = {
enable = false;
language = "en";
enable = true;
tokenFile = config.age.secrets.mastodon-token-smyth.path;
language = "en";
};
telegram = {
enable = true;
@@ -27,10 +27,13 @@
| ${pkgs.gnused}/bin/sed 's/^ref="//;s/"$//'
)
${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION\
url="http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION"
${pkgs.curl}/bin/curl -sSL "$url"\
| ${pkgs.htmlq}/bin/htmlq '#text_main' \
| ${pkgs.gnused}/bin/sed 's/<\/\?hr>//g' \
| ${pkgs.pandoc}/bin/pandoc -f html -t plain --wrap=none
printf '\n%s\n\n#AncientGreek' "$url"
'');
};

View File

@@ -60,8 +60,8 @@ in {
date=$(${pkgs.coreutils}/bin/date +'%m %d %Y')
(
cd ${pkgs.astrolog}/bin
./astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2
# ./astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
./astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
) | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || :
'');
};

View File

@@ -8,12 +8,31 @@
writers.writeDashBin "literature-quote" ''
PATH=$PATH:${lib.makeBinPath [xsv curl gnused]}
ROW=$(curl -Ls http://kmein.github.io/logotheca/quotes.csv | shuf -n1)
(
printf '%s\n\n %s: _%s_, %s\n' \
"$(echo "$ROW" | xsv select 4)" \
"$(echo "$ROW" | xsv select 1)" \
"$(echo "$ROW" | xsv select 2)" \
"$(echo "$ROW" | xsv select 3 | tr : ,)"
) | sed 's/ | /\n/g;s/ || /\n\n/g;s/"\(.*\)"/\1/'
QUOTE="$(echo "$ROW" | xsv select 4)"
echo "$QUOTE" | sed 's/^"//;s/"$//;s/\s*||\s*/\n\n/g;s/\s*|\s*/\n/g'
echo
AUTHOR="$(echo "$ROW" | xsv select 1)"
# Prepare the output
ATTRIBUTION="($AUTHOR"
SOURCE="$(echo "$ROW" | xsv select 2)"
# Add SOURCE if it's not empty
if [ -n "$SOURCE" ]; then
ATTRIBUTION="$ATTRIBUTION: $SOURCE"
fi
LOC="$(echo "$ROW" | xsv select 3 | sed 's/""//;s/-//g')"
# Add LOC if it's not empty
if [ -n "$LOC" ]; then
ATTRIBUTION="$ATTRIBUTION, $LOC"
fi
ATTRIBUTION="$ATTRIBUTION)"
echo "$ATTRIBUTION"
)
''

View File

@@ -29,7 +29,7 @@ in {
../../configs/retiolum.nix
../../configs/spacetime.nix
../../configs/sshd.nix
../../configs/telegram-bots
../../configs/bots
../../configs/admin-essentials.nix
];