This is a public repo for our project that uses angle brackets to monitor environmental change, including the scripts we use harvest image metadata, display a slideshow on a web page, download images, and compile movies. We've also included our sign designs.
These are a couple Ruby scripts we use to help automate the process of getting information about tag usage and making timelapse movies from the images. You don't need to know Ruby to use them, but you should be comfortable with running scripts from the command line. These instructions presume you're runnign some flavor of *nix, but all the underlying libraries are available for Windows so these scripts should work there too.
git clone https://github.com/nerdsfornature/changebrackets.git
cd changebrackets
bundle
This Ruby script harvests image metadata from social media photos using your
tags and stores them in local CSV files or a Google Spreadsheet. Run
ruby fireslurp.rb --help
to see all the options, but basic usage looks like this:
# Save info about Twitter photos for two tags to a Google Spreadsheet
bundle exec ruby fireslurp.rb \
--twitter-key=xxx \
--twitter-secret=yyy \
--google-application-credentials=/path/to/your/key.json \
--google-spreadsheet-id=1234abcd \
morganfire01 morganfire02
# Save info about photos for two tags using config from a YAML file
bundle exec ruby fireslurp.rb -c fireslurp.yaml morganfire01 morganfire02
The last option using a config file is probably the easiest way to go.
fireslurp.yaml
provides an example for the config file. The Google
Spreadsheet ID is just the unique part of your Google Spreadsheet URL, so if
the URL when you're editing it looks like
https://docs.google.com/spreadsheets/d/1HF1fEF4j69Ny6ng9TZYNLYnnRb4J6mPCqmckyOrsomI/edit
,
then the ID is 1HF1fEF4j69Ny6ng9TZYNLYnnRb4J6mPCqmckyOrsomI
. Now here's the tricky part: in order to
write to a Google Spreadsheet, you'll need to do these annoying things:
GOOGLE_APPLICATION_CREDENTIALS
, in your configureation YAML, or using --google-application-credentials
Note that this script only retrieves info about recent photos, so it should be run at least daily, more often if your tags get a lot of use. We recommend cron or launchd.
Downloads the image files referenced in a Google Spreadsheet made by
fireslurp.rb
, aligns them using
TimeLapser, and stitches them into an
animated GIF using ImageMagick. This is really just a little bit of logic on
top of some basic shell commands, which should be pretty obvious in the
script. Note that you can force it to download the files to a particular
folder using the -f
flag, and skip the relatively slow processes of
downloading and alignment.
# Basic usage
bundle exec ruby moviemaker.rb -c fireslurp.yaml morganfire01
# Download all the image files to a folder named myfolder
bundle exec ruby moviemaker.rb -c fireslurp.yaml -f myfolder morganfire01
# Skip download, just do the alignment based on files in myfolder, and make the movie
bundle exec ruby moviemaker.rb -c fireslurp.yaml -f myfolder --skip-download morganfire01
This is a little jQuery-based tool that sort of does what fireslurp does in the browser by pulling in photo data and creating a slideshow. It will only retrieve photos from Flickr and Instagram due to the limitations of Twitter's API in a strictly client-side context like this.
It can also read data from a Google Spreadsheet made by fireslurp, which is one way of getting around the Twitter thing, though doing so requires that you publish your Google Spreadsheet.
Your spreadsheet must meet the following requirements:
Data
fireslurp.rb
, which means it has the following columns as the first row, in this order:
See changeomatic.example.html