Skip to content

Instantly share code, notes, and snippets.

@AlexChittock
Created April 26, 2012 16:25
Show Gist options
  • Save AlexChittock/2500754 to your computer and use it in GitHub Desktop.
Save AlexChittock/2500754 to your computer and use it in GitHub Desktop.
Bulk create facebook test users
#!/bin/bash
if [ $# -le 2 ]; then
echo "Usage : `basename $0` id secret accounts";
exit 1;
fi
NAMES=( alice alex andy armin barry beatrix belle beaumont brody callie carl chris claire dan dave davis derek dwayne edward eric fifi ford georgina greg gordon holly imogen jeff kyle liz melanie november oscar paula quinn reese samantha tilly ullyses violet wanda xiang yuself zack )
SURNAMES=( abercrombie black chi dean edie fox gaant howes india juniper kent lemon middleton nice preston quirk reilly stevens tompsin unice viola wilkins xan yules zenith )
id=$1
secret=$2
token=`curl -s "https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&client_id=$id&client_secret=$secret"`
count=$3
for (( i=1; i<=$count; i++ )); do
name="${NAMES[$RANDOM % ${#NAMES[*]}]}%20${SURNAMES[$RANDOM % ${#SURNAMES[*]}]}"
echo `curl -s "https://graph.facebook.com/$id/accounts/test-users?installed=true&name=$name&locale=en_GB&permissions=read_stream&method=post&$token"`
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment