Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Create a private Twitter list out of someone else's feed so you can read it.
#!/bin/bash
# Create a private Twitter list out of someone else's feed so you can read it.
# The name "ditter" is like "ditto" plus "Twitter" ha ha get it?
#
# Requires Python, GNU coreutils, and https://github.com/sferik/t
#
# Installation:
#
# $ chmod 777 ditter.sh && mv ditter.sh /usr/local/bin/
#
# Usage:
#
# $ ditter <username> [<list_name>]
THEIR_USERNAME=${1}
MY_USERNAME="$(t whoami | grep '^Screen name' | grep -o '[^@]*$')"
LIST_NAME=${2:-"$THEIR_USERNAME-feed"}
t list create --private "$LIST_NAME"
# I aliased GNU split to "gsplit" on my Mac. You may need to change this.
t followings "$THEIR_USERNAME" \
| gsplit -l 100 --filter="xargs t list add \"$LIST_NAME\""
python -mwebbrowser "https://twitter.com/$MY_USERNAME/lists/$LIST_NAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment