diff options
| author | Xe <me@christine.website> | 2022-04-28 03:22:06 +0000 |
|---|---|---|
| committer | Xe <me@christine.website> | 2022-04-28 03:22:06 +0000 |
| commit | 3f3db571681bf383e5d87af0f5903dd53fc0ff7a (patch) | |
| tree | 6563eb8ec56f88b148ea956859de8b4d9456992f | |
| parent | f0e05faa014743f8c784dbd2aec7c5260828f1e3 (diff) | |
| download | x-3f3db571681bf383e5d87af0f5903dd53fc0ff7a.tar.xz x-3f3db571681bf383e5d87af0f5903dd53fc0ff7a.zip | |
update preflight
Signed-off-by: Xe <me@christine.website>
| -rw-r--r-- | flake.nix | 6 | ||||
| -rw-r--r-- | mastodon/robocadey/main.go | 1 | ||||
| -rw-r--r-- | run/robocadey.preflight.sh | 7 | ||||
| -rw-r--r-- | run/robocadey.service.in | 1 |
4 files changed, 5 insertions, 10 deletions
@@ -78,15 +78,9 @@ ${python}/bin/python3 ${./mastodon/robocadey/gpt2/main.py} ''; robocadey-psvc = let - preflight = pkgs.writeShellApplication { - name = "cadeybot-preflight"; - runtimeInputs = with pkgs; [ jq coreutils gnugrep gnused ]; - text = builtins.readFile ./run/robocadey.preflight.sh; - }; service = pkgs.substituteAll { name = "robocadey.service"; src = ./run/robocadey.service.in; - inherit preflight; robocadey = self.packages.${system}.robocadey; }; gpt2-service = pkgs.substituteAll { diff --git a/mastodon/robocadey/main.go b/mastodon/robocadey/main.go index 09e81ca..bd28a23 100644 --- a/mastodon/robocadey/main.go +++ b/mastodon/robocadey/main.go @@ -109,7 +109,6 @@ func main() { n := ev.Data.(madon.Notification) if n.Type == "mention" { - time.Sleep(5 * time.Second) ln.Log(ctx, ln.F{ "target": n.Account.Acct, }) diff --git a/run/robocadey.preflight.sh b/run/robocadey.preflight.sh index 7fcb2e9..04be027 100644 --- a/run/robocadey.preflight.sh +++ b/run/robocadey.preflight.sh @@ -1,8 +1,11 @@ #!/usr/bin/env bash -rm tweet_minimal.json sed 's/window.YTD.tweet.part0 = //' < tweets.js \ | jq '.[] | [ select(.tweet.retweeted == false) ] | .[].tweet.full_text' \ | sed -r 's/\s*\.?@[A-Za-z0-9_]+\s*//g' \ | grep -v 'RT:' \ - | jq --slurp . > tweet_minimal.json + | jq --slurp . \ + | jq -r .[] \ + | sed -e 's!http[s]\?://\S*!!g' \ + | sed '/^$/d' \ + > tweets.txt diff --git a/run/robocadey.service.in b/run/robocadey.service.in index 1ed58cf..77327b9 100644 --- a/run/robocadey.service.in +++ b/run/robocadey.service.in @@ -2,7 +2,6 @@ Description=Robo-Cadey [Service] -ExecStartPre=@preflight@/bin/preflight ExecStartPre=@robocadey@/bin/robocadey --read-from=./robocadey.gob ExecStart=@robocadey@/bin/robocadey StateDirectory=xeserv.robocadey |
