Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Riffsy GIF Search Instant Answer #2154

Merged
merged 6 commits into from
Nov 12, 2015
Merged

Conversation

bryanhart
Copy link
Contributor

What does your Instant Answer do?
The Riffsy GIF Search and Emoji Search instant answers provide animated GIFs based on a simple query ("cat gifs"), or provide GIFs that relay an expression similar to a provided emoji.

What problem does your Instant Answer solve (Why is it better than organic links)?
GIF results animate inline so that a user can preview the GIF while scrolling through the list to quickly find the GIF she wants to share. GIFs are ranked by their likelihood to be shared in conversation, and emoji search enables a user to quickly locate a GIF to express a desired emotion.

What is the data source for your Instant Answer? (Provide a link if possible)
Riffsy - http://www.riffsy.com, http://api.riffsy.com

Riffsy's GIF Keyboard is the top-ranked and largest GIF-sharing app on iOS, driving 6 Billion+ GIF and video views per month.

Why did you choose this data source?

  1. The GIFs load fast, and are optimized for mobile.
  2. Riffsy's API provides results based on emoji.
  3. Riffsy is localized to many languages

Are there any other alternative (better) data sources?
The Gifs instant answer currently uses an alternate source.

What are some example queries that trigger this Instant Answer?
"cat gifs", "happy gif", "thumbs up riffsy", "😂", "👍"

Which communities will this Instant Answer be especially useful for? (gamers, book lovers, etc)
Riffsy's ability to recommend GIFs for use in conversations is useful for a growing population of users looking to find GIFs to use in their conversations across messengers and social networks.

Is this Instant Answer connected to a DuckDuckHack Instant Answer idea?
https://duck.co/ideas/idea/6323/riffsy-gif-emoji-search

Which existing Instant Answers will this one supersede/overlap with?
There is currently a Gifs instant answer that provides GIF search functionality through an alternate source.

Are you having any problems? Do you need our help with anything?
I would like to consolidate the GIF Search and the Emoji Search answers into a single module, but it did not seem possible based on how the two modules parse search queries.

What are the terms of use for the API? Will DuckDuckGo need specific authorization (e.g. an API key)? Are there any costs associated with API usage?
We've created an API key for use with Riffsy's API. There are no costs associated with the API usage, and Riffsy's full TOS is here: http://www.riffsy.com/legal-terms. Feel free to contact frank@riffsy.com if there are any additional questions.

Where did you hear about DuckDuckHack? (For first time contributors)
Gabe // Stephen Mendel // David McIntosh

What does the Instant Answer look like? (Provide a screenshot for new or updated Instant Answers)
screen shot 2015-09-01 at 2 42 46 pm
screen shot 2015-09-01 at 2 43 18 pm


IA Page: https://duck.co/ia/view/riffsy

@moollaza
Copy link
Member

moollaza commented Sep 4, 2015

@bryanhart Hey !

Thanks for taking the time to contribute! We really appreciate it.

We work closely with every contributor to make Instant Answers the best they can be, so we appreciate your patience as we look over your code. From here, the process usually goes like this:

  1. Pull Request is reviewed by the DuckDuckGo staff and
    community
  2. Staff and community will leave feedback with any necessary updates to the function or design.
  3. Once you've made any necessary corrections, then your Instant Answer will be merged and deployed live on DuckDuckGo!

If you have any questions along the way, feel free to ask our staff or community:

Community Leaders:

  • MrChrisW
  • mattr555
  • mintsoft
  • killerfish
  • bradcater
  • javathunderman
  • loganom
  • TomBebbington

Staff:

More Info: https://duck.co/duckduckhack/submission_and_review

attribution web => ["http://www.riffsy.com","Riffsy"],
twitter => "riffsyapp";

spice to => 'http://api1.riffsy.com/v1/search?tag=$1&key={{ENV{DDG_SPICE_RIFFSY_APIKEY}}}&safesearch=strict&searchtype=emoji';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanhart can you please send me an API key for testing? moollaza[at]duckduckgo[dot]com

@moollaza
Copy link
Member

moollaza commented Sep 4, 2015

@bryanhart I've left some initial feedback. Sorry for all the noise, I didn't realize at first that the modules and JS were nearly identical.

As I mentioned in the comments, we can combine the triggers into 1 or multiple regex triggers (unfortunately we can't mix regex and words triggers) and then we can remove the 2nd package, js file, test you made.

Once things are simplified I'll be able to put this up on a testing machine 👍

We can also simplify the final package name. DDG::Spice::Riffsy sounds good to me.

@moollaza
Copy link
Member

@bryanhart Ping! I'm just checking in to see if need anything from us? We'd love to see this go live!

There's absolutely no rush, just wanted to make sure you're not stuck on anything.

@bryanhart
Copy link
Contributor Author

Hey @moollaza - yeah a few things came up here but I should be back to this sometime this week!

@jagtalon
Copy link
Member

IA Page for this: https://duck.co/ia/view/riffsy_emoji_search

env.ddg_spice_riffsy_emoji_search = function(api_result){

// Validate the response (customize for your Spice)
if (!api_result || api_result.error || !api_result.results) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanhart When the query is invalid results can still be an empty array. ![] will result to false so probably best to check api_result.results.length as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bryanhart does .error actually come up?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can! It would most likely be a temporary issue on our side.

@jagtalon
Copy link
Member

Let's up the caching to 30 days too if that's alright https://github.com/duckduckgo/zeroclickinfo-spice/search?utf8=%E2%9C%93&q=30d

@jagtalon
Copy link
Member

@bryanhart @moollaza I think the Gif in the detail view is too small. Don't you agree?

@bryanhart
Copy link
Contributor Author

Sorry for the delay! There's a few improvements that I made to the Riffsy API to simplify the IA module a bit. Otherwise, most of the changes requested have been made, the exception being that I set caching to be 1 day instead of the requested 30, as we do update these results pretty regularly. I'm actually not sure what the default value is, so that might have been unnecessary. Happy to have further discussion about what an appropriate value might be.

@moollaza
Copy link
Member

moollaza commented Oct 8, 2015

@bryanhart thanks a lot, we'll take a look soon!

I set caching to be 1 day instead of the requested 30, as we do update these results pretty regularly. I'm actually not sure what the default value is, so that might have been unnecessary.

The default is 24 hours, but making it explicit doesn't hurt ;)

@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 8, 2015 19:52 Active
@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 8, 2015 20:52 Active
@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 9, 2015 14:15 Active
@bryanhart
Copy link
Contributor Author

Checking in to see if there's any other improvements you'd like me to make!

@daxtheduck daxtheduck deployed to beta.duckduckgo.com October 21, 2015 19:07 Active
@moollaza
Copy link
Member

@bryanhart sorry for the delay! This has now been deployed to beta.duckduckgo.com: https://beta.duckduckgo.com/?q=game+of+thrones+gifs

I spoke with the team, and we have a couple concerns/issues with loading the moving gifs. We're worried that showing all the gifs moving will be overwhelming and irritate users.

  1. For mobile, it's going to eat up a lot of bandwidth, so I think in those cases, we should use the static image and show the larger, moving version only once it's clicked.

  2. For desktop we think that showing the moving gifs on hover is a good way of preventing them from having to click to see each gif moving.

I decided to mess around with this and wrote a little event handler that implements this.

You can see the code here: https://gist.github.com/moollaza/f5435985c6058fd3d6df

And here's a working demo: https://13f995a3.ngrok.io/?q=duck+gifs&ia=gifs -- this is running locally on my pc so it might be a little slow. If you update your PR with this I'll be able to deploy the updates to Beta.

We plan to update the images template to handle all of this eventually, but in the interest of moving this PR along, I think this should work for now.

What do you think?

@moollaza
Copy link
Member

moollaza commented Nov 4, 2015

Ping! @bryanhart I'm just checking in to see if you're still interested in finishing this one up? We'd love to see this go live!

There's absolutely no rush, just wanted to make sure you're not stuck on anything.

@bryanhart
Copy link
Contributor Author

Hey Zaahir! Yes most definitely - I'll be back to finish this up tomorrow!

@bryanhart
Copy link
Contributor Author

All set! I integrated your changes, many apologies for the delay getting that done. Let me know if you'd like to see any other improvements!

@moollaza
Copy link
Member

@bryanhart sorry for the delay, thanks for updating, I'll take a look right now

@daxtheduck daxtheduck deployed to beta.duckduckgo.com November 12, 2015 22:21 Active
@moollaza
Copy link
Member

@bryanhart this LGTM 👍

Thanks a lot for contributing (we really appreciate it 😃).

I'll be sure to get this live soon, and will let you know when it goes live!

@moollaza moollaza assigned moollaza and unassigned abeyang Nov 12, 2015
moollaza added a commit that referenced this pull request Nov 12, 2015
Riffsy GIF Search Instant Answer
@moollaza moollaza merged commit 21edb69 into duckduckgo:master Nov 12, 2015
@bryanhart
Copy link
Contributor Author

Awwwyeahhhh thank you for your help @moollaza!!

@moollaza
Copy link
Member

@bryanhart congrats! It's live: https://duckduckgo.com/?q=duck+gifs&t=ffab&ia=gifs

Thanks again for taking the time to contribute! We really appreciate it.

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

Successfully merging this pull request may close these issues.

5 participants