Skip to content

Instantly share code, notes, and snippets.

@TristanWiley
Created April 3, 2017 00:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TristanWiley/ad47d459818312e358fb15dff52bbd50 to your computer and use it in GitHub Desktop.
Save TristanWiley/ad47d459818312e358fb15dff52bbd50 to your computer and use it in GitHub Desktop.
## declare an array variable
declare -a arr=("100003351194097", "1190589341", "100002607181556", "549728756", "759129034", "100015955369034");
length="${#arr[@]}";
# echo $length;
count=0;
for i in "${arr[@]}"
do
echo $(curl -sb -H "Accept: application/json" "https://graph.facebook.com/v2.8/"$i"?access_token=<API_TOKEN>" | jq -r '.name')","$i >> greetings.csv
((count++));
echo $count"/"$length;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment