Hypermasher is a Node.js application which shows users a stream of the latest Hyperlapse videos.
371
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 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:
docker ps returns a valid resultcd into the Hypermasher root directoryINSTAGRAM_CLIENT_ID and INSTAGRAM_CLIENT_SECRET environment variables in a new file called .env in this directorydocker-compose up -d (-d to run our containers in detached mode)boot2docker ip command. Ex: http://192.168.59.103:8000You'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:
redis-servercd into the Hypermasher root directorynpm installnpm startYou'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:
INSTAGRAM_CLIENT_ID and INSTAGRAM_CLIENT_SECRET environment variables in your terminal session. I like using autoenv to make this easy.bin/getVideosYou 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
Content type
Image
Digest
sha256:448e5181a…
Size
301.6 MB
Last updated
over 11 years ago
docker pull atbaker/hypermasher