tenorjs
Version:
TenorJS is a lightweight NodeJS wrapper around the Tenor.com API.
31 lines (24 loc) • 1.09 kB
Markdown
## TenorJS v.1.0.5
### 1. Search autocomplete!
TenorJS now offers the practical feature of search autocomplete suggestions!
Search autocomplete will only take one argument, which is the user's input.
Here's a code snippet:
```js
// Tenor.Suggest.autocomplete("SEARCH TERM")
Tenor.Suggest.autocomplete("anim").then(Result => {
console.log(Result);
}).catch(console.error);
// { results: [ 'animals', 'anime' ] }
```
### 2. Search suggestions!
You can now listen on the users' search input and offer them suggestions based on it!
Search suggestions can be called very easily and will take two arguments, the first being the user's input/search query and the second being the amount of search suggestions you'd like Tenor to return.
Here's a code snippet:
```js
// Tenor.Suggest.suggestions("SEARCH TERM", "LIMIT HERE")
Tenor.Suggest.suggestions("anime", "3").then(Result => {
console.log(Result);
}).catch(console.error);
// { results: [ 'anime kiss', 'anime love', 'anime hug' ] }
```
More updates are coming in the near future so stay tuned!