npm install --save frinkiac
This is a Node.js search wrapper for the Amazing Frinkiac Search Engine. https://frinkiac.com
Here's a simple example of using Frinkiac's (public?) search API to get a list of episode and timestamp results for a Simpsons related quote.
// basic search usagevar frinkiac = ;frinkiac;
This module's search API eg.
frinkiac.search('stupid flanders') returns a promise with the original response object,
So you need to check the response object status before moving on.
As a helper function, you can use
frinkiac.memeMap(val, idx) to turn all the search responses into proper meme url's,
but make sure to bind the frinkiac object to the map eg.
This module also provides URL utilities that you can use to form your own requests These are unbound URL utils, and might be all you need to design your own req, res workflow.
var mySearchURL = frinkiac; // ''var myMemeURL = frinkiac // ''var myCaptionURL = frinkiac // ''
.memeMap(Array) => function(item, idx) => Array
Util to quickly map over search results and return proper image URLs.
.captionURL(episode, timestamp) => String
Util to generate a URL for the Frinkiac Caption API. Episode and timestamp are strings you get from the search url.
.memeURL(episode, timestamp, caption) => String
Util to generate a URL for the Frinkiac Meme API which returns an image with a caption. Args can all be Strings.
.searchURL(quotation) => String
Util to generate a URL that can be used to get Search results from Frinkiac. Input whatever quote, name, etc. to get results.
.search(quotation) => Promise
API helper to get you a direct interface with Frinkiac API. No setup or teardown needed as long as you have a network connection and Ajax stack in either Node, Chrome, etc. Will return an Axios promise that should be checked for status codes before returning the next thenable. Also note, Axios' response object uses
response.data to reference the actual data from response.
npm test to run tests and
node examples/example.js to see a set of results returned in the console.
MIT © Amir Djavaherian