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
# Old script I made and had laying around, it's not really adequate corpared to something I'd create | |
# these days, but it works | |
# Simple script to poll Twitter for tweets and route them to a Discord webhook | |
# Run it periodically, using something like Cron | |
# Requires the following environment variables, can also be read from a file `.env` in the same | |
# directory as this one: | |
# USERNAME: Case insensitive twitter handle without the @ | |
# LAST_TWEET: File name to store the last tweet ID, must have read/write permissions | |
# BEARER: Bearer token for twitter API | |
# WEBHOOK: Discord's webhook URL |
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
#!/bin/bash | |
set -o nounset -o pipefail | |
IMDS_ENDPOINT=${IMDS_ENDPOINT:-"http://169.254.169.254"} | |
IMDS_VERSION=${IMDS_VERSION:-latest} | |
MONITOR_INTERVAL=${MONITOR_INTERVAL:-5} | |
check_dependencies() { | |
local dependencies=("jq" "curl") |