Skip to content

Instantly share code, notes, and snippets.

Last active January 20, 2023 22:00
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
# Script to migrate a Mastodon-exported following list to
# Generate an API key here:
# Then go to your Mastodon instances data export, e.g.
# where you can download your following list in CSV format
# Or use Fedifinder to generate a CSV of people you follow on Twitter with Mastodon/ActivityPub accounts:
# Then simply pipe that list to this script, for example:
# ~/Documents/ < ~/Downloads/following_accounts.csv
while IFS=, read mastodonuser boosts; do
echo -n Bringing ${mastodonuser} to…
urlusername=$(echo $mastodonuser|sed -e 's/@/%40/')
if curl -sf "${urlusername}" -H "Authorization: $mbapikey" > /dev/null; then
echo "OK! 😀"
echo "failed. 🤔"
contentlength=$(echo -n "$postdata" | wc -c | awk '{print $1}')
echo -n Following ${mastodonuser}…
if curl -sf '' -XPOST -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H "Content-Length: $contentlength" -H "Authorization: $mbapikey" --data "$postdata" > /dev/null ; then
echo "OK! 😀"
echo "failed. 🤔"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment