Last active
November 5, 2019 06:00
-
-
Save oct2pus/353afa7ad74696ea4a7bfb5c9230fd02 to your computer and use it in GitHub Desktop.
simple script fish homestuck update checker for mastodong. You have to login seperately prior to this working.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
# requires toot, a trained model.json, and generator | |
# (found @ github.com/oct2pus/jadebot/markov/generator) | |
while true | |
toot post (./generator) | |
sleep 3600 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/fish | |
set parturl (curl -s https://upd8.ninja/latestupd8.json | jq -r ".parturl") | |
echo $parturl > ./latest.txt | |
while true | |
set parturl (curl -s https://upd8.ninja/latestupd8.json | jq -r ".parturl") | |
if test ! -z $parturl | |
and [ (echo $parturl) != (cat latest.txt) ] | |
set title (curl -s https://upd8.ninja/latestupd8.json | jq -r ".title") | |
set pages (curl -s https://upd8.ninja/latestupd8.json | jq -r ".pages") | |
printf "New #homestuck update!\nTitle: %s\nPages: %s\nLink: https://homestuck2.com/%s" $title $pages $parturl | toot post | |
echo $parturl > ./latest.txt | |
end | |
sleep 10 | |
end |
updated to check for a nil value in $parturl
added a markov script to run simultaneously.
requires generator and a trained model.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
toot is only available as of buster. you can install it from pip3 with
pip3 install toot
, and then modify your $PATH environmental variable to include.local/bin
which is where toot is downloaded to. (in~/.config/config.fish
addset -x PATH ~/.config/bin $PATH
), should work if you set it in bash prior tho.this code is dedicated to the public domain.