This is an open source Mixmax Slash Command, that will search www.omdbapi.com, an online database for both Movie's and Television Series, and provide you with a brief plot summary, the year it was released, as well the IMDB rating which links to the results IMDB page for further info.
See http://developer.mixmax.com/docs/overview-slash-commands for more information about how to use this example code in Mixmax.
- JavaScript
- Node Express Server
- Synchronize
- Request
This was a fun project as it was my first experience using Node Express for a server, as well as the accompanying packages. I've primarily utizlied rails' WEBrick or Puma servers, but have been wanting to learn about Node Express, so enjoyed that.
- Install using
npm install
- Run using
npm start
ornode server.js
To simulate locally how Mixmax calls the typeahead URL (to return a JSON list of typeahead results), run:
curl http://localhost:9145/typeahead?text=alcatraz
or in your browser navigate to:
http://localhost:9145/typeahead?text=alcatraz
To simulate locally how Mixmax calls the resolver URL (to return HTML that goes into the email), run:
curl http://localhost:9145/resolver?text=alcatraz
or in your browser navigate to:
http:/localhost:9145/resolver?text=alcatraz
If you wish to install the slash command to your current Mixmax slash commands, please follow these instructions:
- git clone https://github.com/brentluna/mixmax-omdb-slash
- Run
npm install
andnpm start
ornode server.js
- Verify it works by visiting http://localhost:9145/typeahead?text=alcatraz and http://localhost:9145/resolver?text=alcatraz in your browser.
- Open up your Mixmax Dashboard (settings > integrations< Add Slash command)
- Enter the following inputs
Input Name | Value |
---|---|
Name | My OMDB Search |
Command | omdb |
Paramater placeholder | [Search] |
Typeahead API URL | http://localhost:9145/resolver |
Resolver API URL | http://localhost:9145/resolver |
- Update styling
- Get the tests in the test branch working, merge into master