#!/bin/sh # # track_followers.sh # # Convenience wrapper for followerdump.py # # Obtains the current list of followers and commits them to Git # # Copyright © 2017–2019 by martin f. krafft # Released under the Artistic Licence 2.0 # MYDIR="${0%/*}" cd "$MYDIR" export LC_ALL=$(locale -a | grep utf8 | head -1) ./followerdump.py | sort > followers/dump cd followers [ -s dump ] || exit 0 COUNT=$(wc -l dump | cut -d' ' -f1) MSG="Twitter follower set update, total=$COUNT" git add dump if git commit -m"$MSG" >&2; then git show HEAD fi