Created
April 18, 2014 20:38
-
-
Save aybabtme/11063367 to your computer and use it in GitHub Desktop.
> To apply, email us at jobs+n@getclever.com, where n is the number of students in the Clever sandbox API data set with a last name that begins with the letter 'V'. Send us one or more things from [resume, github profile, recent side projects, linkedin URL, Stack Overflow profile, etc], and let us know how you solved our 'puzzle.'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pagecount=$(curl -s -H 'Authorization: Bearer DEMO_TOKEN' -X GET https://api.clever.com/v1.1/students | jq '.paging.total') | |
echo "$pagecount pages" | |
now=$(date "+%Y-%m-%d-%H:%M.%S") | |
tmpfile=".$now-tmp_clever.json" | |
touch $tmpfile | |
echo "Saving pages to $tmpfile" | |
for i in $(seq 1 $pagecount); do | |
echo "Getting page $i" | |
curl -s -H 'Authorization: Bearer DEMO_TOKEN' -X GET https://api.clever.com/v1.1/students?page=$i >> $tmpfile | |
done | |
echo "Last names starting with W:" | |
cat $tmpfile | jq -s 'map(.data[]) | map(.data.name.last)' | grep '.*"W' | wc -l | |
rm $tmpfile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oups:
gives 9.