diff options
| author | Ryan Baumann <ryan.baumann@gmail.com> | 2016-08-23 17:09:00 -0400 |
|---|---|---|
| committer | Ryan Baumann <ryan.baumann@gmail.com> | 2016-08-23 17:09:00 -0400 |
| commit | c28a4a55d93a0e54d232e0564fd4f66fe18d7283 (patch) | |
| tree | d13311c68f1871ab43ab8276fd355f9af6950f4e | |
| parent | 4d49e254189cfa70929cd00d1ec263440db10159 (diff) | |
Guard against unset NYPL_API_TOKEN environment variable
| -rwxr-xr-x | nypl_recrop.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/nypl_recrop.rb b/nypl_recrop.rb index 304fc29..a5337ae 100755 --- a/nypl_recrop.rb +++ b/nypl_recrop.rb @@ -8,6 +8,10 @@ NYPL_API_TOKEN = ENV["NYPL_API_TOKEN"] NYPL_AUTH = "Token token=\"#{NYPL_API_TOKEN}\"" NYPL_ENDPOINT = "http://api.repo.nypl.org/api/v1/items" +if NYPL_API_TOKEN.nil? + abort("You must set an NYPL_API_TOKEN environment variable with your token from http://api.repo.nypl.org/") +end + stereo_metadata = JSON.parse(RestClient.get("http://stereo.nypl.org/view/#{ARGV[0]}.json")) unless stereo_metadata['external_id'] == 0 |
