NOTE: I no longer maintain this repository. I also believe the Instagram API it used has been deprecated. Further, I no longer own hypermasher.com and I am not responsible for the content there today.
Hypermasher is a Node.js application which shows users a stream of the latest Hyperlapse videos set to chill music.
It was created by Andrew T. Baker as part of his funemployment. It is open source under the Apache 2.0 license.
Hypermasher inspired Hyperlax, a much better implementation of this concept created by Taylor Crane.
Both apps were featured in the very first episode of Rate My App. You can watch the video here.
Hypermasher is a fairly lean app and takes minutes to set up. It uses redis to store metadata about the videos it serves, but has no other components outside of Node.js.
To run Hypermasher, you need to get API keys from Instagram. Once you have those, you can run Hypermasher natively through npm or through Docker using docker-compose.
To get your Instagram API keys, visit their developer site: http://instagram.com/developer. Follow the prompts for "Register your Application".
You'll know you're done when you see values for CLIENT_ID
and CLIENT_SECRET
.
Docker is an easy way to run Hypermasher locally, but if you have Node.js and redis-server installed on your machine, you might prefer running Hypermasher through npm
as described in the next section.
In addition to Docker, you will need docker-compose. Installation instructions here: https://docs.docker.com/compose/install/
To run Hypermasher locally using Docker:
- Make sure your Docker daemon is running and connected to your client. You can test this by making sure
docker ps
returns a valid result cd
into the Hypermasher root directory- Set the
INSTAGRAM_CLIENT_ID
andINSTAGRAM_CLIENT_SECRET
environment variables in a new file called.env
in this directory - Run
docker-compose up -d
(-d
to run our containers in detached mode) - Connect to Hypermasher in your browser at port 8000
- If you're running Docker natively go to http://localhost:8000
- If you're using boot2docker go to port 8000 on the IP address provided by the
boot2docker ip
command. Ex: http://192.168.59.103:8000
You're now running Hypermasher locally, but we haven't fetched any videos from Instagram yet. To do that, we need to run one additional command:
$ docker-compose run node bin/getVideos
You should see a result like 33 videos primed
. Now refresh your browser - you should see the first video loaded and ready to play. Hit any play button on the screen to start Hypermasher.
If you have Node.js and redis-server installed locally, then you can run Hypermasher without Docker.
To run Hypermasher locally through npm:
- Start the redis server with
redis-server
cd
into the Hypermasher root directory- Install the Node.js dependencies with
npm install
- Start Hypermasher with
npm start
- Go to http://localhost:3000 to see Hypermasher in your browser
You're now running Hypermasher locally, but we haven't fetched any videos from Instagram yet. To do that, we need to run one additional command:
- Set the
INSTAGRAM_CLIENT_ID
andINSTAGRAM_CLIENT_SECRET
environment variables in your terminal session. I like using autoenv to make this easy. - Run the command
bin/getVideos
You should see a result like 33 videos primed
. Now refresh your browser - you should see the first video loaded and ready to play. Hit any play button on the screen to start Hypermasher.
When running in production (export NODE_ENV=production
), Hypermasher caches the rendered template for the /hyperlapse route to speed up response time.
After a deployment, you can clear that template cache by running the executable found at bin/clearViews
.
Hypermasher includes a couple end-to-end tests powered by Protractor. Hypermasher isn't an Angular app, but I wanted to learn Protractor a little better so I used it anyway.
You will need to install Protrator and a webdriver. For most people, all you need is:
$ npm install -g protractor
$ webdriver-manager update
Before you can run the tests, you need to start the Hypermasher server and the Selenium server:
$ fig up -d
$ webdriver-manager start
Then, run the tests with:
$ protractor tests/conf.js