Skip to content

Instantly share code, notes, and snippets.

@oct2pus
Last active November 5, 2019 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oct2pus/353afa7ad74696ea4a7bfb5c9230fd02 to your computer and use it in GitHub Desktop.
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.
#!/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
#!/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
@oct2pus
Copy link
Author

oct2pus commented Apr 15, 2019

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 add set -x PATH ~/.config/bin $PATH), should work if you set it in bash prior tho.

this code is dedicated to the public domain.

@oct2pus
Copy link
Author

oct2pus commented Apr 19, 2019

updated to check for a nil value in $parturl

@oct2pus
Copy link
Author

oct2pus commented Oct 26, 2019

updated for homestuck...2!!

peggle2

@oct2pus
Copy link
Author

oct2pus commented Nov 5, 2019

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