Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Provide Search Capability #2

Open
edm00se opened this issue Apr 11, 2018 · 2 comments
Open

Feature Request: Provide Search Capability #2

edm00se opened this issue Apr 11, 2018 · 2 comments

Comments

@edm00se
Copy link

edm00se commented Apr 11, 2018

Instead of a random GIF, how about one that matches text?

This would preferably be in the style of the /giphy <search text> followed by shuffle/select/cancel behavior with the Giphy slash command.

@bjyoungblood
Copy link
Owner

I like that idea, and I even looked briefly at doing this originally, but I was working on a time limit.

The main hurdle involved in implementing this is that the Tumblr API only allows filtering by tag (exact match), so we'd need to implement the following:

  1. Enumerate all posts on first startup (Tumblr's API returns max 50 per call)
  2. Store data in an external cache like Redis (Heroku's has a free tier that's almost certainly good enough).
  3. Occasionally poll for new posts (Tumblr doesn't support webhooks)
  4. Add text matching goodness

Ultimately, this would make the bot better, as it'd respond a lot more quickly (no lag for calling Tumblr's API), and there'd be no danger of large Slack teams hitting Tumblr's API rate limit (though 1k/hour and 5k/day won't be a problem for most).

@edm00se
Copy link
Author

edm00se commented May 11, 2018

So I imagine an easier way of going about this will be to make use of the Swear Trek (and Effin' Birds) database that is under production and access is to patreon supporters w/ $1/mo or more. Presumably pass any access tokens into environment variables for direct use, which would eliminate the need to directly use Tumblr's API, store a cached index of posts, and polling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants