Skip to content

Instantly share code, notes, and snippets.

@laser
Last active August 29, 2015 14:22
Show Gist options
  • Save laser/d25d5f8d11a6c8efa347 to your computer and use it in GitHub Desktop.
Save laser/d25d5f8d11a6c8efa347 to your computer and use it in GitHub Desktop.
testing the services
#!/bin/bash
echo "Running diffs against responses from service at: $1"
for run in {1..9999}
do
curl $1/mobile/videos/search?query=Star+Trek\&pageSize=1 | json_pp | diff api-movieclips/test/fixtures/search.json -
if [ $? -eq 1 ]; then
osascript -e 'display notification "MovieClips API Video Search call failed" with title "MovieClips API Failure"'
fi
curl $1/mobile/videos/autocomplete?query=the\&pageSize=1 | json_pp | diff api-movieclips/test/fixtures/autocomplete.json -
if [ $? -eq 1 ]; then
osascript -e 'display notification "Autocomplete failed" with title "MovieClips API Failure"'
fi
curl $1/mobile/playlists/auto/447801411744 | json_pp | diff api-movieclips/test/fixtures/autoplaylist.json -
if [ $? -eq 1 ]; then
osascript -e 'display notification "Autoplaylist failed" with title "MovieClips API Failure"'
fi
curl $1/mobile/main | json_pp | diff api-movieclips/test/fixtures/home.json -
if [ $? -eq 1 ]; then
osascript -e 'display notification "Mobile Main failed" with title "MovieClips API Failure"'
fi
done

To run it:

> cd fandango
> git clone [email protected]:fandango/api-movieclips.git api-movieclips
> chmod +x looper.sh
> ./looper.sh http://dev-backstage.fandango.com/movieclips
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment