]> git.madduck.net Git - code/twitter-archiver.git/blob - track_followers.sh

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

README updates
[code/twitter-archiver.git] / track_followers.sh
1 #!/bin/sh
2 #
3 # track_followers.sh
4 #
5 # Convenience wrapper for followerdump.py
6 #
7 # Obtains the current list of followers and commits them to Git
8 #
9 # Copyright © 2017–2019 by martin f. krafft <madduck@madduck.net>
10 # Released under the Artistic Licence 2.0
11 #
12
13 MYDIR="${0%/*}"
14 cd "$MYDIR"
15
16 export LC_ALL=$(locale -a | grep utf8 | head -1)
17
18 ./followerdump.py | sort > followers/dump
19 cd followers
20 [ -s dump ] || exit 0
21 COUNT=$(wc -l dump | cut -d' ' -f1)
22 MSG="Twitter follower set update, total=$COUNT"
23 git add dump
24 if git commit -m"$MSG" >&2; then
25   git show HEAD
26 fi