Skip to content

Commit

Permalink
Changed ruby script to executable for heroku scheduler compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
JangoSteve committed Jul 8, 2012
1 parent 79e6095 commit e806bc5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@ setJSON({
}
});
```

## Running script

To run the script, make sure it's executable:

```
sudo chmod u+x bin/get_counts
```

Then run it, be sure that your `AWS_ACCESS_KEY` and `AWS_SECRET_KEY`
variables are present in your environment:

```
AWS_ACCESS_KEY={YOUR_ACCESS_KEY_HERE} AWS_SECRET_KEY={YOUR_SECRET_KEY_HERE} bin/get_counts
```
8 changes: 7 additions & 1 deletion run.rb → bin/get_counts
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env ruby

# Use Bundler to use correct gems/dependencies
require "rubygems"
require "bundler/setup"

require 'open-uri'
require 'json'
require 'openssl'
Expand Down Expand Up @@ -96,7 +102,7 @@
f.write('setJSON(' + output.to_json + ');')
}

puts "Uploading to S3 bucket #{S3_BUCKET}..."
puts "Uploading to #{S3_FILENAME} in S3 bucket #{S3_BUCKET}..."
AWS::S3::Base.establish_connection!(
:access_key_id => ENV['AWS_ACCESS_KEY'],
:secret_access_key => ENV['AWS_SECRET_KEY']
Expand Down

0 comments on commit e806bc5

Please sign in to comment.